#include <bits/stdc++.h>
using namespace std;
string s;
long n;
int wcount(int pos) {
  int count = 0;
  for (int i = pos; i <= n; i++) {
    if (s[i] == '.') count++;
  }
  return count;
}
int bcount(int pos) {
  int count = 0;
  for (int i = pos - 1; i >= 0; i--) {
    if (s[i] == '#') count++;
  }
  return count;
}
int main() {
  long min = 0;
  cin >> n;
  cin >> s;
  long tmp;
  min = bcount(0) + wcount(0);
  for (long i = 1; i <= n; i++) {
    tmp = bcount(i) + wcount(i);
    if (tmp < min) min = tmp;
  }
  cout << min << endl;
  return 0;
}
