#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int i;
  int black = 0;
  int white = 0;
  int counter = 0;
  int flag = 0;
  int j;
  for (i = 0; i < n; i++) {
    if (s[i] == '#' && flag == 0) {
      flag = 1;
      for (j = i; j < n; j++)
        if (s[j] == '.') black++;
    }
  }
  counter = black;
  black = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      for (j = i; j < n; j++)
        if (s[j] == '.') black++;
      if (white + black < counter) counter = black + white;
      white++;
      black = 0;
    }
  }
  cout << counter << endl;
}
