#include <bits/stdc++.h>
using namespace std;
int cnt[200][200000 + 10];
int main() {
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cnt[s[i]][i]++;
    if (i != 0) {
      cnt['#'][i] += cnt['#'][i - 1];
      cnt['.'][i] += cnt['.'][i - 1];
    }
  }
  int b = cnt['.'][n - 1];
  int ans = n;
  for (int i = 0; i < n; i++) {
    ans = min(ans, cnt['#'][i] + b - cnt['.'][i]);
  }
  cout << ans << endl;
  return 0;
}
