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