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