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