#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 7;
const long long mod = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int brk = 0, wit = 0;
  if (s[n - 1] == '#') {
    brk--;
  }
  for (long long i = 0; i < (long long)(n); i++) {
    if (s[i] == '#')
      brk++;
    else if (s[i] == '.')
      wit++;
  }
  cout << min(brk, wit) << endl;
}
