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