#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int i, j;
  int count = 0;
  int min = n;
  for (i = 0; i <= n; i++) {
    for (j = 0; j < n; j++) {
      if ((j < i && s.at(j) != '.') || (j >= i && s.at(j) != '#')) {
        count++;
      }
    }
    if (count < min) {
      min = count;
    }
    count = 0;
  }
  cout << min << endl;
}
