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