#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int index = 0;
  for (int i = 1; i < N; i++) {
    if (S[i - 1] == '#' && S[i] == '.') {
      index = i;
      break;
    }
  }
  int black = 0, white = 0, tmp = 0;
  string Sback = S.substr(index);
  string Sfront = S.substr(0, index);
  black = count(Sback.begin(), Sback.end(), '#');
  white = count(Sback.begin(), Sback.end(), '.');
  if (index == 0) {
    cout << 0 << endl;
    return 0;
  } else {
    tmp = black + count(Sfront.begin(), Sfront.end(), '#');
    cout << min(white, tmp) << endl;
  }
  return 0;
}
