#include <bits/stdc++.h>
using namespace std;

int main(){
  string s;
  cin >> s;
  int out = 0;
  int count = 0;
  for(int i = 0; i < s.size(); i++){
    if(i == 0){
      for(int j = 0; j < s.size(); j++){
        if(s.at(j) == '.') count++;
        out = count;
      }else{
        if(s.at(i - 1) == '.' & s.at(i) == '.'){
          count--;
        }else if(s.at(i - 1) == '#' & s.at(i) == '#'){
          count++;
        }else if(s.at(i - 1) == '.' & s.at(i) == '#'){
          count--;
        }else if(s.at(i - 1) == '#' & s.at(i) == '.'){
          count++;
        }
        if(out > count){
          out = count;
        }
      }
    }
  }
  cout << out;
}