#include <bits/stdc++.h>
using namespace std;
int index(char c) {
  char x[] = "Bulbasr";
  for (int i = 0; i < 7; i++)
    if (x[i] == c) return i;
  return -1;
}
int a[10];
int main() {
  char in[100002];
  cin.getline(in, 100001);
  int len = strlen(in);
  for (int i = 0; i < len; i++) {
    if (index(in[i]) != -1) a[index(in[i])]++;
  }
  int min = 1234567890;
  for (int i = 0; i < 7; i++)
    if (i != 1 && i != 4) {
      if (min > a[i]) min = a[i];
    } else {
      if (min > (a[i] / 2)) min = a[i] / 2;
    }
  if (min == 1234567890)
    cout << 0 << endl;
  else
    cout << min << endl;
  return 0;
}
