#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, x = 0, y = 0, z = 0;
  cin >> N;
  string S;
  cin >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      x++;
    }
    if (S[i] == '#') {
      y++;
    }
  }
  if (x >= y) {
    if (S[N - 1] != '#') {
      cout << y << endl;
    } else {
      for (int k = 0; k < N - 1; k++) {
        if (S[N - 1 - k] == '#' && S[N - 2 - k] == '#') {
          z++;
        } else {
          z = z;
        }
      }
      cout << y - z << endl;
    }
  } else {
    cout << x << endl;
  }
}
