Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main() {
- string S;
- cin>>S;
- int B=0,u=0,l=0,b=0,a=0,s=0,r=0,count=0,n=1;
- int ln=S.size();
- for(int i=0; i<ln; i++) {
- if(S[i]=='B') B++;
- else if(S[i]=='u') u++;
- else if(S[i]=='l') l++;
- else if(S[i]=='b') b++;
- else if(S[i]=='s') s++;
- else if(S[i]=='a') a++;
- else if(S[i]=='r') r++;
- if(B>=n&&b>=n*2&&u>=n*2&&a>=n*2&&l>=n&&s>=n&&r>=n) {
- count++;
- n++;
- }
- }
- cout<<count<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement