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