#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  string s;
  cin >> n;
  cin >> s;
  long long ans = 10000000;
  for (long long i = 0; i < (n); i++) {
    long long c = 0;
    for (long long j = 0; j < (i); j++) {
      if (s[j] == '#') {
        c++;
      }
    }
    for (long long j = i; j < n - 1; j++) {
      if (s[j] == '.') {
        c++;
      }
    }
    ans = min(c, ans);
  }
  cout << ans << endl;
  return 0;
}
