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