#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, ans = 0;
  char s[200100];
  cin >> n >> s;
  char c = s[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
      c = s[i + 1];
    }
  }
  cout << min(ans, n - ans);
}
