#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  string T = S;
  int N = (int)S.size();
  reverse(T.begin(), T.end());
  int W = 0;
  while (W < N) {
    if (S[W] == '.' && W < N - 1) {
      W++;
    }
  }
  int cntw = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      cntw++;
    }
  }
  cntw -= W;
  int B = 0;
  while (B < N) {
    if (T[B] == '#' && B < N - 1) {
      B++;
    }
  }
  int cntb = 0;
  for (int i = 0; i < N; i++) {
    if (T[i] == '#') {
      cntb++;
    }
  }
  cntb -= B;
  cout << min(cntw, cntb) << endl;
  return 0;
}
