#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long LINF = 1LL << 60;
const int INF = 1 << 30;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool flag1 = false;
  bool flag2 = false;
  int cnt1 = 0;
  int cnt2 = 0;
  if (s[0] == '.') {
    flag2 = true;
  } else {
    flag1 = true;
  }
  for (int i = 1; i < s.size(); i++) {
    if (flag1 && s[i] == '.') {
      cnt1++;
      flag2 = true;
    } else if (flag2 && s[i] == '#') {
      cnt2++;
      flag1 = true;
    }
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
