#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, count = 0;
  string S;
  cin >> N >> S;
  int now;
  while (1) {
    if (S[0] == '#' && S[1] == '.') {
      S[0] = '.';
      count++;
    }
    for (int i = 1; i < N - 1; i++) {
      now = i;
      if (S[i] == '#' && S[i + 1] == '.') {
        S[i] = '.';
        count++;
        if (S[i - 1] == '#') {
          break;
        }
      }
    }
    if (now == N - 2) {
      break;
    }
  }
  cout << count << endl;
  return 0;
}
