#include <bits/stdc++.h>
using namespace std;
const int inf = 1000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = inf, cou = inf, flag = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (s.at(i) == '#') flag = 1;
    if (s.at(i) == '.' && flag) {
      if (cnt == inf)
        cnt = 1;
      else
        cnt++;
    }
    if (s.at(i) == '#' && i != n - 1) {
      if (cou == inf)
        cou = 1;
      else
        cou++;
    }
  }
  if (cou == inf && cnt == inf) cou = 0;
  if (cnt == 0) {
    cout << 0 << endl;
    return 0;
  }
  cout << min(cou, cnt) << endl;
}
