# your code goes here

players = input()
show_players = 0

for e in players:
	if not e == 'F':
		show = True
		for c in players:
			if c == 'I':
				show = False
		if show == True:
			show_players = show_players + 1
print(show_players)