#include <bits/stdc++.h>
using namespace std;
map<char, int> mp;
string s;
int n, i, j, k, sum, d;
int main() {
  cin >> s;
  n = s.size();
  for (i = 0; i < n; i++) mp[s[i]]++;
  k = min(mp['B'], mp['b']);
  d = min(mp['u'] / 2, mp['a'] / 2);
  j = min(mp['l'], min(mp['s'], mp['r']));
  cout << min(k, min(d, j));
}
