Codeforces Round 174 (Div. 2)
B
Cows and Poker Game
Codeforces
1000
原题
← AC →
翻译中…

There are $*n*$ cows playing poker at a table. For the current betting phase, each player's status is either "ALLIN", "IN", or "FOLDED", and does not change throughout the phase. To increase the suspense, a player whose current status is not "FOLDED" may show his/her hand to the table. However, so as not to affect any betting decisions, he/she may only do so if all other players have a status of either "ALLIN" or "FOLDED". The player's own status may be either "ALLIN" or "IN".

翻译中…

Find the number of cows that can currently show their hands without affecting any betting decisions.

翻译中…

Input

翻译中…

The first line contains a single integer, $*n*$ ($2 ≤ *n* ≤ 2·10^{5}$). The second line contains $*n*$ characters, each either "A", "I", or "F". The $*i*$-th character is "A" if the $*i*$-th player's status is "ALLIN", "I" if the $*i*$-th player's status is "IN", or "F" if the $*i*$-th player's status is "FOLDED".

翻译中…

Output

翻译中…

The first line should contain a single integer denoting the number of players that can currently show their hands.

翻译中…

Note

翻译中…

In the first sample, cows 1, 4, 5, and 6 can show their hands. In the second sample, only cow 3 can show her hand.

翻译中…

样例

Input #1
6
AFFAAA
Output #1
4
InputCopy OutputCopy
Input #2
3
AFI
Output #2
1
InputCopy OutputCopy
题目信息
题号
284B
时间限制
2 s
内存限制
256 MB
标签
暴力
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。