#include <bits/stdc++.h>
using namespace std;
int n, cnt1, cnt2;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      cnt1++;
    else if (s[i] == '#')
      cnt2++;
  }
  cout << (cnt1 >= cnt2 ? cnt2 : cnt1) << endl;
}
