#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, dem_cham = 0, dem_thang = 0;
  string s;
  cin >> s;
  if (s[0] == '.') {
    t = s.find('#', 1);
    for (int i = t; i < s.length(); i++) {
      if (s[i] == '#') {
        dem_thang += 1;
      } else
        dem_cham += 1;
    };
    if (dem_cham < dem_thang) {
      cout << dem_cham;
    } else
      cout << dem_thang;
  } else {
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '.') {
        dem_cham += 1;
      } else
        dem_thang += 1;
    };
    if (dem_cham < dem_thang) {
      cout << dem_cham;
    } else
      cout << dem_thang;
  }
  return 0;
}
