#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int INF = 1000000;
const double PI = 3.14159265359;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  for (long long i = n - 1; i > 0; i--) {
    if (s[i - 1] == '#' && s[i] == '.') {
      ans++;
      s[i] = '#';
    }
  }
  cout << ans << endl;
  return 0;
}
