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