#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
long long gcd(long long x, long long y) {
  if (x < y) {
    long long temp = x;
    x = y;
    y = temp;
  }
  long long r = x % y;
  while (r != 0) {
    x = y;
    y = r;
    r = x % y;
  }
  return y;
}
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int n;
  int cnt = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      cnt++;
      S[i + 1] = '#';
    }
  }
  cout << cnt << endl;
}
