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