#include<bits/stdc++.h>
#define int long long
using namespace std;
string s;
int top,a[100005],top1,b[100005],ans;
signed main(){
	cin>>s;
	int len=s.size();
	for(int i = 0;i<len;i++){
		if(s[i]=='I')a[++top]=i;
		else b[++top1]=i;
	}
	if(top==0){
		cout<<2;
		return 0;
	}
	if(top1==0){
		cout<<1;
		return 0;
	}
	for(int i = 1;i<=top1;i++){
		if(b[i]-1!=b[i-1]&&i!=1)ans++;
	}
	cout<<ans;
	return 0;
}

0 条评论

目前还没有评论...

信息

ID
4580
时间
ms
内存
MiB
难度
7
标签
递交数
26
已通过
12
上传者