CF284B.Cows and Poker Game

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There are nn 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.

输入格式

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

输出格式

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

输入输出样例

  • 输入#1

    6
    AFFAAA
    

    输出#1

    4
    
  • 输入#2

    3
    AFI
    

    输出#2

    1
    

说明/提示

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.

首页