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