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