#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 5;
const long long mod = 1e9 + 7;
const long long N = 2e5 + 314;
const long double pi = 3.1415926535897932384626433832795;
long long bp(long long pow, long long n) {
  long long d = 1;
  while (n) {
    if (n % 2 == 1) d = (d * pow) % mod;
    pow = (pow * pow) % mod;
    n /= 2;
  }
  return d;
}
void solve() {
  string second;
  cin >> second;
  map<char, long long> m = {{'B', 0}, {'u', 0}, {'l', 0}, {'b', 0}, {'a', 0},
                            {'s', 0}, {'a', 0}, {'u', 0}, {'r', 0}};
  for (long long i = 0; i < (long long)second.size(); i++) m[second[i]]++;
  cout << min({m['B'], m['u'] / 2, m['l'], m['b'], m['a'] / 2, m['s'], m['r']});
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) solve();
}
