#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int a, b;
  for (int i = 0; i < N; i++) {
    b = 0;
    for (int j = 0; j < i; j++) {
      if (S.at(i) != '.') b++;
    }
    for (int j = i; j < N; j++) {
      if (S.at(i) != '#') b++;
    }
    b = a;
    a = min(a, b);
  }
  cout << a << endl;
}
