#include <bits/stdc++.h>
int n, m, k, l;
std::map<char, int> a;
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0);
  std::string s;
  std::cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) {
    a[s[i]]++;
  }
  m = std::min(a['B'], a['b']);
  k = std::min(a['a'] / 2, a['u'] / 2);
  l = std::min(a['l'], std::min(a['s'], a['r']));
  std::cout << std::min(m, std::min(k, l));
}
