#include <bits/stdc++.h>
using namespace std;
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  bool flag = false;
  long long cnt = 0, cnt1 = 0;
  for (long long i = 0; i < n; i++) {
    if (flag == true) {
      if (s[i] == '#') {
        cnt1++;
      } else {
        cnt++;
      }
    }
    if (s[i] == '#' && flag == false) {
      flag = true;
      cnt1++;
    }
  }
  cout << min(cnt, cnt1) << endl;
  return 0;
}
