#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long mod = 1e9 + 7;
const int inf = 1 << 30;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  bool b = 0;
  int ans1 = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '#') b = 1;
    if (b && s[i] == '.') ans1++;
  }
  bool w = 0;
  int ans2 = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') w = 1;
    if (w && s[i] == '#') ans2++;
  }
  cout << min(ans1, ans2) << endl;
}
