#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int count;
  bool matched;
  int numBtoW = 0;
  matched = false;
  for (int i = N - 2; i >= 0; --i) {
    if (!matched and S[i] == '#' and S[i + 1] == '.') {
      matched = true;
      ++numBtoW;
    } else if (matched and S[i] == '#')
      ++numBtoW;
    else if (matched and S[i] == '.')
      matched = false;
  }
  int numWtoB = 0;
  matched = false;
  for (int i = 0; i < N; ++i) {
    if (!matched and S[i] == '#' and S[i + 1] == '.') {
      matched = true;
      ++numWtoB;
    } else if (matched and S[i + 1] == '.')
      ++numWtoB;
    else if (matched and S[i + 1] == '#')
      matched = false;
  }
  cout << min(numBtoW, numWtoB);
}
