#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  string s;
  cin >> s;
  long long n = s.length();
  map<char, long long> m;
  m['B'] = 1;
  m['u'] = 1;
  m['l'] = 1;
  m['b'] = 1;
  m['a'] = 1;
  m['s'] = 1;
  m['r'] = 1;
  for (long long i = 0; i < n; i++) {
    if (m[s[i]] > 0) {
      m[s[i]]++;
    }
  }
  long long c1 = min(m['u'] - 1, m['a'] - 1);
  long long c11 = min(m['B'] - 1, m['b'] - 1);
  long long c22 = min(m['l'] - 1, m['r'] - 1);
  c22 = min(m['s'] - 1, c22);
  long long c3 = min(c11, c22);
  long long num1 = c1 / 2;
  long long num2 = c3;
  cout << min(num1, num2) << "\n";
  return 0;
}
