#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod = 1e9 + 7;
ll inf = 1e10;
int main() {
  ll N, kuro[200000] = {0}, siro[200000] = {0};
  string s;
  cin >> N >> s;
  for (int i(0); i < N; i++) {
    if (i == 0) {
      kuro[i] = (s[i] == '#' ? 1 : 0);
      siro[i] = (s[i] == '.' ? 1 : 0);
      continue;
    }
    if (s[i] == '#') {
      kuro[i] = kuro[i - 1] + 1;
      siro[i] = siro[i - 1];
    } else {
      siro[i] = siro[i - 1] + 1;
      kuro[i] = kuro[i - 1];
    }
  }
  ll ans(min(kuro[N - 1], siro[N - 1]));
  for (int i(0); i < N - 1; i++) {
    ans = min(ans, kuro[i - 1] + siro[N - 1] - siro[i]);
  }
  cout << ans << endl;
  return 0;
}
