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