#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, tmp_count = 0, min = 300000;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    tmp_count = 0;
    for (int j = 0; j < N; j++) {
      if (j < i && S.compare(j, j, "#") == 0) {
        tmp_count++;
      }
      if (j > i && S.compare(j, j, ".") == 0) {
        tmp_count++;
      }
    }
    if (tmp_count < min) {
      min = tmp_count;
    }
  }
  cout << min << endl;
  return 0;
}
