#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int A[8] = {0};
  cin >> s;
  int l = s.length();
  for (int i = 0; i < l; i++) {
    if (s[i] == 'B')
      A[0]++;
    else if (s[i] == 'u')
      A[1]++;
    else if (s[i] == 'l')
      A[2]++;
    else if (s[i] == 'b')
      A[3]++;
    else if (s[i] == 'a')
      A[4]++;
    else if (s[i] == 's')
      A[5]++;
    else if (s[i] == 'r')
      A[6]++;
  }
  cout << min(
      A[0],
      min(A[2], min(A[3], min(A[5], min(A[6], min(A[1] / 2, A[4] / 2))))));
  return 0;
}
