def mistake1(s):
global mistake
mistake=0
if s =='a':
mistake += 1
print(mistake)
return mistake
while True:
s=input()
mistake1(s)
mistake = 0
def mistake1(word):
global mistake
if s =='a':
mistake += 1
print("Mistake increment")
else:
mistake -= 1
print("Mistake decrement")
if __name__ == "__main__":
ask_flag = True
while ask_flag:
try:
s = input("Input word: ")
if s != "q":
mistake1(s)
except KeyboardInterrupt:
ask_flag = False
print(f"Current Count mistake = {mistake}")
print('Exit')