#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int commDiv(int a, int b) {
  int n = gcd(a, b);
  int result = 0;
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        result += 1;
      else
        result += 2;
    }
  }
  return result;
}
int main() {
  map<char, int> m;
  string s;
  cin >> s;
  for (auto x : s) {
    m[x]++;
  }
  int ans = m['B'];
  ans = min(ans, m['u'] / 2);
  ans = min(ans, m['a'] / 2);
  ans = min(ans, m['b']);
  ans = min(ans, m['s']);
  ans = min(ans, m['r']);
  ans = min(ans, m['l']);
  cout << ans << "\n";
  return 0;
}
