#include <bits/stdc++.h>
using namespace std;
string s, st = "Bulbasaur";
int ans = 10000000, c['z' + 1];
int main() {
  getline(cin, s);
  for (int i = 0; i < s.size(); ++i) ++c[s[i]];
  ans = min(ans, c['B']);
  ans = min(ans, c['u'] / 2);
  ans = min(ans, c['b']);
  ans = min(ans, c['l']);
  ans = min(ans, c['a'] / 2);
  ans = min(ans, c['s']);
  ans = min(ans, c['r']);
  printf("%d", ans);
  return 0;
}
