#include <bits/stdc++.h>
using namespace std;
const int inf = 1000007;
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 == 1) cnt++;
    if (s.at(i) == '#' && i < (n - 1)) cou++;
  }
  cout << min(cou, cnt) << endl;
}
