#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int s0[n];
  int s1[n];
  int min = 999999;
  int k = 0;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      s0[i] = 0;
    } else if (s[i] == '#') {
      s0[i] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int k = 0; k < n; k++) {
      s1[k] = 0;
      if (k < i) {
        s1[k] = 0;
      } else {
        s1[k] = 1;
      }
      if (s0[k] == s1[k]) {
      } else if (s0[k] != s1[k]) {
        flag++;
      }
    }
    if (flag < min) {
      min = flag;
    }
  }
  cout << min << endl;
  return 0;
}
