#include <bits/stdc++.h>
using namespace std;
int n;
char c;
int a, b;
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> c;
    if (int(c) == int('#'))
      a++;
    else
      b++;
  }
  cout << min(a, b);
  return 0;
}
