#include <bits/stdc++.h>
using namespace std;
map<char, int> c;
string s;
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++) c[s[i]]++;
  cout << min(c['B'],
              min(c['b'],
                  min(c['l'],
                      min(c['a'] / 2, min(c['u'] / 2, min(c['r'], c['s']))))))
       << endl;
  return 0;
}
