#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = (int)S.size();
  vector<int> B(N, 0);
  vector<int> W(N, 0);
  if (S[0] == '#') {
    B[0] = 1;
  }
  if (S[N - 1] == '.') {
    W[N - 1] = 1;
  }
  for (int i = 1; i < N; i++) {
    if (S[i] == '#') {
      B[i] = B[i - 1] + 1;
    } else {
      B[i] = B[i - 1];
    }
  }
  for (int i = N - 2; i >= 0; i--) {
    if (S[i] == '.') {
      W[i] = W[i + 1] + 1;
    } else {
      W[i] = W[i + 1];
    }
  }
  int ans = 1e9;
  for (int i = 0; i < N; i++) {
    ans = min(ans, B[i] + W[i]);
  }
  cout << ans << endl;
  return 0;
}
