#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int min = N;
  for (int i = 0; i < N; i++) {
    int count = 0;
    for (int j = 0; j < N; j++) {
      if (i > j) {
        if (S.at(j) == '#') {
          count++;
        }
      } else {
        if (S.at(j) == '.') {
          count++;
        }
      }
    }
    if (min > count) {
      min = count;
    }
  }
  cout << min << endl;
}
