#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A, mode, B, C, x, xx;
  A = 0;
  B = 0;
  C = 0;
  char S;
  while (cin >> S) {
    if (mode == 0) {
      if (S == '#') {
        mode++;
      }
    } else {
      if (S == '.') {
        A++;
      }
    }
    if (S == '#') {
      B++;
    } else {
      C++;
    }
  }
  x = min(A, C);
  xx = min(x, B);
  cout << xx << endl;
}
