#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int x = 0;
  int ans_min = 9999999;
  for (int i = 0; i < N + 1; i++) {
    char* str = new char[200000];
    for (int j = 0; j < N; j++) {
      if (i <= j) {
        str[j] = '#';
      } else {
        str[j] = '.';
      }
    }
    x = 0;
    for (int j = 0; j < N; j++) {
      if (S[j] != str[j]) {
        x++;
      }
    }
    if (x < ans_min) {
      ans_min = x;
    }
  }
  cout << ans_min << endl;
  return 0;
}
