#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  string s;
  cin >> n >> s;
  int c = 0, f = 0;
  int l = s.length();
  for (int i = 0; i < l; i++) {
    if (s[i] == '#') f = 1;
    if (s[i] == '.' && f == 1) c++;
  }
  cout << min(c, l - c) << "\n";
  return 0;
}
