#include <bits/stdc++.h>
using namespace std;
long long int k, n, j, B, b, l, a, s, u, r;
string ins, st;
int main() {
  cin >> st;
  for (int i = 0; i < st.length(); i++) {
    if (st[i] == 'B')
      B++;
    else if (st[i] == 'b')
      b++;
    else if (st[i] == 'a')
      a++;
    else if (st[i] == 's')
      s++;
    else if (st[i] == 'u')
      u++;
    else if (st[i] == 'r')
      r++;
    else if (st[i] == 'l')
      l++;
  }
  u = u / 2;
  a = a / 2;
  long long int t = min(B, l);
  t = min(a, t);
  t = min(b, t);
  t = min(s, t);
  t = min(u, t);
  t = min(r, t);
  cout << t;
}
