#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N, cin >> S;
  bool mode = (S[0] == '#');
  int count = 0, blackcount = mode ? 1 : 0;
  int last = N - 1;
  if (S[last] == '#') {
    for (int i = last - 1; 0 <= i; --i) {
      if (S[i] == '.') {
        last = i;
        break;
      }
    }
  }
  for (int i = 1; i <= last; ++i) {
    if (mode) {
      if (S[i] == '.')
        ++count;
      else
        ++blackcount;
    } else {
      if (S[i] == '#') {
        ++blackcount;
        mode = true;
      }
    }
  }
  cout << min(count, blackcount) << endl;
  return 0;
}
