#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans = 0;
  bool t = 0;
  int kuro = 0;
  for (int i = 0; i < N; i++) {
    if (s.at(i) == '#') {
      t = 1;
      kuro++;
    }
    if (s.at(i) == '.' && t == 1) {
      ans++;
    }
  }
  cout << min(kuro, ans) << endl;
  return 0;
}
