#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n;
  string s;
  cin >> s;
  vector<int> freq(27, 0);
  for (i = 0; i < s.length(); ++i) {
    if (s[i] == 'B')
      freq[26]++;
    else if (s[i] >= 'a' && s[i] <= 'z')
      freq[s[i] - 'a']++;
  }
  cout << (min(freq[26],
               min(freq['u' - 'a'],
                   min(freq['l' - 'a'],
                       min(freq[1],
                           min(freq['s' - 'a'],
                               min(freq[0] >> 1, min(freq['u' - 'a'] >> 1,
                                                     freq['r' - 'a']))))))))
       << endl;
  return 0;
}
