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