response = input("Do you want to eat a candy bar (Y/N)? ")

cost_of_candy_bar = 7
number_of_candy_bars = 0
total_cost = 0

while response == "Y":
    number_of_candy_bars = number_of_candy_bars + 1
    total_cost = total_cost + cost_of_candy_bar

    response = input("Do you want to eat one more (Y/N)? ")

print("You ate", number_of_candy_bars, "candy bars.")
print("They cost you", total_cost, "dollars.")
