#include <bits/stdc++.h>
using namespace std;
long long n, ans;
string s;
signed main() {
  cin >> n >> s;
  string p = s;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
      s[i + 1] = '#';
    }
  }
  long long karians = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (p[i] == '#' && p[i + 1] == '.') {
      karians++;
      p[i] = '.';
    }
  }
  cout << min(ans, karians) << endl;
}
