#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, black = 0, white = 0;
  bool found = false;
  string s;
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') found = 1;
    if (found == 1 && s[i] == '#') black++;
    if (found == 1 && s[i] == '.') white++;
  }
  cout << min(white, black);
  return 0;
}
