#include <bits/stdc++.h>
using namespace std;
int cnt[500];
string s;
int main() {
  cin >> s;
  int i, N = s.length();
  for (i = 0; i < N; i++) cnt[s[i]]++;
  int res = min(cnt['B'], cnt['u'] / 2);
  res = min(res, cnt['l']);
  res = min(res, cnt['b']);
  res = min(res, min(cnt['a'] / 2, cnt['s']));
  res = min(res, cnt['u']);
  res = min(res, cnt['r']);
  cout << res << "\n";
  return 0;
}
