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