text = input() ans = 0 for x in range(len(text)): if text[x] == 'А' and (text[x-1] == ' ' or x == 0): ans += 1 print(ans)