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