#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  string s;
  int n;
  cin >> n >> s;
  int m = 2147483647;
  for (int i = 0; i < n; i++) {
    int c = 0;
    for (int j = 0; j < n; j++) {
      if (j <= i && s[j] == '#') c++;
      if (j > i && s[j] == '.') c++;
      if (m <= c) break;
    }
    m = min(m, c);
  }
  cout << m << endl;
  return 0;
}
