#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, string>;
using graph = vector<vector<ll>>;
const long long inf = 2147483647;
const ll INF = 9223372036854775807;
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  long long ans = 0;
  for (ll i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
