#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int maxNumberOfBalloons(string text) {
vector<int> freq(26, 0);
for(char c: text) freq[c - 'a'] ++;
int res = freq['b' - 'a'];
res = min(res, freq['a' - 'a']);
res = min(res, freq['l' - 'a'] / 2);
res = min(res, freq['o' - 'a'] / 2);
res = min(res, freq['n' - 'a']);
return res;
}
};
int main() {
cout << Solution().maxNumberOfBalloons("loonbalxballpoon") << endl;
return 0;
}