#include <bits/stdc++.h>
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
using namespace std;
int main(int argc, char const *argv[]) {
  int n, cnt1 = 0, cnt2 = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < (int)n - 1; i++) {
    if (s[i] == '#') {
      cnt1++;
    }
    if (s[i] == '.') {
      cnt2++;
    }
  }
  cout << (cnt1 < cnt2 ? cnt1 : cnt2) << endl;
  return 0;
}
