#!/usr/bin/env python
# -*- coding: utf-8 -*-
#



def main():
	count_cow = int(raw_input())
	poker_str = raw_input()
	count_allin = poker_str.count('A')
	count_folded = poker_str.count('F')
	if count_allin + count_folded == count_cow:
		print(count_allin)
	elif count_allin + count_folded + 1 == count_cow:
		print(1)
	else:
		print(0)
	return 0

if __name__ == '__main__':
	main()

