#include <bits/stdc++.h>
const int MAX_N = 1e5 + 6;
using namespace std;
char str[MAX_N];
int a[10];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> str;
  int len = strlen(str), count = 0;
  for (int i = 0; i < len; i++)
    if (str[i] == 'a')
      a[0]++;
    else if (str[i] == 'u')
      a[1]++;
    else if (str[i] == 'b')
      a[2]++;
    else if (str[i] == 'l')
      a[3]++;
    else if (str[i] == 's')
      a[4]++;
    else if (str[i] == 'r')
      a[5]++;
    else if (str[i] == 'B')
      a[6]++;
  a[0] /= 2;
  a[1] /= 2;
  sort(a, a + 7);
  cout << a[0] << endl;
}
