#include <bits/stdc++.h>
using namespace std;
string YN(bool y) { return (y ? "YES" : "NO"); }
string yn(bool y) { return (y ? "Yes" : "No"); }
string ON(bool y) { return (y ? "OK" : "NG"); }
int main(void) {
  int n, ans1 = 0, ans2 = 0;
  string s;
  cin >> n >> s;
  int start = n;
  for (int i = (int)(0); i < (int)(n); i++) {
    if (s[i] == '#') {
      start = i;
      break;
    }
  }
  for (int i = (int)(0); i < (int)(n); i++) {
    if (i >= start && s[i] == '.') ans1++;
    if (s[i] == '#') ans2++;
  }
  cout << min(ans1, ans2) << endl;
}
