#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main() {
  int n, c0 = 0, c1 = 0;
  string s;
  cin >> n >> s;
  bool flag = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag = true;
    }
    if (flag && s[i] == '.') c0++;
    if (s[i] == '#') c1++;
  }
  cout << min(c0, c1);
}
