#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 0;
  for (int i = 0; i < S.length() - 1; ++i) {
    if (S[i] == '#' && S[i + 1] == '.') ++ans;
  }
  cout << ans;
  return 0;
}
