#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
char s[maxn];
int vis[55];
int main() {
  cin >> s;
  int len = strlen(s);
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < len; i++) {
    vis[s[i] - 'A']++;
  }
  int m = 1111111;
  m = min(m, vis['a' - 'A'] / 2);
  m = min(m, vis['s' - 'A']);
  m = min(m, vis['u' - 'A'] / 2);
  m = min(m, vis['b' - 'A']);
  m = min(m, vis['l' - 'A']);
  m = min(m, vis['r' - 'A']);
  m = min(m, vis['B' - 'A']);
  cout << m << endl;
  return 0;
}
