#include <bits/stdc++.h>
inline void in(int &MAGNUS) { scanf("%d", &MAGNUS); }
inline void out(int MAGNUS) { printf("%d\n", MAGNUS); }
inline void in(int &MAGNUS, int &CLAR) { scanf("%d%d", &MAGNUS, &CLAR); }
inline void out(int MAGNUS, int CLAR) { printf("%d %d\n", MAGNUS, CLAR); }
inline void inl(long long &LIV) { scanf("%lld", &LIV); }
inline void inl(long long &LIV, long long &MART) {
  scanf("%lld%lld", &LIV, &MART);
}
inline void outl(long long LIV) { printf("%lld\n", LIV); }
inline void outl(long long LIV, long long MART) {
  printf("%lld %lld\n", LIV, MART);
}
using namespace std;
int main() {
  string s;
  cin >> s;
  int many[155];
  memset(many, 0, sizeof(many));
  for (int i = 0; i <= (int)s.size() - 1; i++) many[s[i]]++;
  int ans = min(
      many['B'],
      min(many['u'] / 2,
          min(many['l'],
              min(many['b'], min(many['a'] / 2, min(many['s'], many['r']))))));
  out(ans);
  return 0;
}
