#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0, mn = 1000001;
  char a[100000];
  string s;
  cin >> n >> s;
  for (int i = 0; i < n + 1; ++i) {
    int j = 0;
    cnt = 0;
    for (1; j < i; ++j) a[j] = '.';
    for (1; j < n; ++j) a[j] = '#';
    for (int k = 0; k < n; ++k) {
      if (s[k] != a[k]) cnt = cnt + 1;
    }
    mn = min(mn, cnt);
  }
  cout << mn << endl;
  return 0;
}
