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