#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  string b;
  cin >> a >> b;
  int e = 0;
  int x, y;
  for (int i = a - 1; i >= 0; i--) {
    if (b[i] == '#')
      e++;
    else {
      if (b[i] == '.' && b[i - 1] == '#') x = i;
      break;
    }
  }
  int f = 0;
  for (int i = 0; i < a; i++) {
    if (b[i] == '.')
      f++;
    else {
      if (b[i] == '#' && b[i - 1] == '.') y = i;
      break;
    }
  }
  int z = 0;
  if (x != NULL && y != NULL) {
    for (int i = f + 1; i < a - 1 - e; i++) {
      if (b[i] == '#') {
        z = 1;
        break;
      }
    }
    if (z == 0) {
      cout << 2 << endl;
    }
  }
  int c = 0, d = 0;
  for (int i = f; i < a - e; i++) {
    if (b[i] == '.') c++;
    if (b[i] == '#') d++;
  }
  if (c > d)
    cout << d << endl;
  else
    cout << c << endl;
  return 0;
}
