#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  string s;
  int count = 0;
  cin >> a >> s;
  for (int i = 0; i < a; i++) {
    if (s[i] == '.') count++;
  }
  if (s[a] == '#') count = count - 1;
  if (count > a / 2) count = a - count;
  cout << count << endl;
  return 0;
}
