#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string ss = s;
  int ans = 0;
  int i = 0;
  while (i < n - 1) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
      s[i + 1] = '#';
    }
    i++;
  }
  int ans1 = 0;
  s = ss;
  i = (int)s.size() - 1;
  while (i > 0) {
    if (s[i - 1] == '#' && s[i] == '.') {
      ans1++;
      s[i - 1] = '.';
    }
    i--;
  }
  if (s[0] == '#' && s[1] == '.') ans1++;
  cout << min(ans, ans1) << endl;
}
