#include <bits/stdc++.h>
using namespace std;
int main() {
  int white = 0, black = 0;
  int n;
  char c;
  cin >> n;
  char* s = new char[n];
  for (int i = 0; i < n; i++) {
    cin >> c;
    s[i] = c;
    if (c == '.') white++;
  }
  int min = n;
  int all;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      black++;
    } else {
      white--;
    }
    all = black + white;
    if (all <= min) min = all;
  }
  cout << min;
}
