#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  string result;
  int white = 0;
  int black = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != '.') {
      white++;
    } else {
      black++;
    }
  }
  int min = 1e9;
  for (int i = 0; i < n; i++) {
    if (0 == i) continue;
    string w_b;
    for (int j = 0; j < n; j++) {
      if (j < i) {
        w_b += ".";
      } else {
        w_b += "#";
      }
    }
    int cnt = 0;
    for (int j = 0; j < n; j++) {
      if (s[j] != w_b[j]) {
        cnt++;
      }
    }
    if (min > cnt) min = cnt;
  }
  if (min < white && min < black) {
    cout << min << endl;
  } else if (white < black) {
    cout << white << endl;
  } else {
    cout << black << endl;
  }
  return 0;
}
