#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  std::string S;
  cin >> N >> S;
  std::string last;
  long int ham_min = 1000000000000;
  for (int index = 0; index < N + 1; index++) {
    for (int j = 0; j < N; j++) {
      if (index <= j) {
        last[j] = '#';
      } else {
        last[j] = '.';
      }
    }
    int ham = 0;
    for (int i = 0; i < N; i++) {
      if (S[i] != last[i]) {
        ham++;
      }
    }
    if (ham < ham_min) {
      ham_min = ham;
    }
  }
  std::cout << ham_min << std::endl;
  return 0;
}
