#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  char *c = new char[S.size() + 1];
  strcpy(c, S.c_str());
  int cnt = 0;
  int sharp = 0;
  int dot = 0;
  for (int i = 0; i < N - 1; i++) {
    if (c[i] == '#') {
      sharp++;
    } else {
      dot++;
    }
  }
  if (sharp >= dot) {
    for (int i = N - 1; i > 0; i--) {
      if (c[i - 1] == '#' and c[i] == '.') {
        cnt++;
        c[i] = '#';
      }
    }
  } else {
    for (int i = N - 1; i > 0; i--) {
      if (c[i - 1] == '#' and c[i] == '.') {
        cnt++;
        c[i - 1] = '.';
      }
    }
  }
  cout << cnt << endl;
}
