#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
const long long int MOD = 1e9 + 7;
const long long int INF = 1e10;
const long double PI = (acos(-1));
signed main() {
  long long int N;
  string S;
  cin >> N >> S;
  long long int ans = 0;
  for (long long int i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      ans++;
      S[i + 1] = '#';
    }
  }
  cout << ans << endl;
}
