#include <bits/stdc++.h>
using namespace std;
int f[256];
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) f[s[i]]++;
  int ans;
  ans =
      min(f['B'],
          min(f['u'] / 2,
              min(f['l'], min(f['b'], min(f['a'] / 2, min(f['s'], f['r']))))));
  cout << ans;
}
