#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    if (i != n - 1 && s[i] == '#') cnt1++;
    if (i != 0 && s[i] == '.') cnt2++;
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
