#include <bits/stdc++.h>
using namespace std;
enum en { B, u, l, b, a, s, r };
int main() {
  string str;
  cin >> str;
  int count[7] = {0, 0, 0, 0, 0, 0, 0};
  for (int i = 0; i < (int)str.size(); i++) {
    switch (str[i]) {
      case 'B':
        count[B]++;
        break;
      case 'u':
        count[u]++;
        break;
      case 'l':
        count[l]++;
        break;
      case 'b':
        count[b]++;
        break;
      case 'a':
        count[a]++;
        break;
      case 's':
        count[s]++;
        break;
      case 'r':
        count[r]++;
        break;
    }
  }
  count[u] /= 2;
  count[a] /= 2;
  sort(count, count + 7);
  cout << count[0] << endl;
  return 0;
}
