#include <bits/stdc++.h>
using namespace std;
int n, cnt1[220000], cnt2[220000], ans = 1e9;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    if (i == 0) {
      cnt1[i] = (s[i] == '.');
      cnt2[i] = (s[i] == '#');
    } else {
      cnt1[i] = cnt1[i - 1] + (s[i] == '.');
      cnt2[i] = cnt2[i - 1] + (s[i] == '#');
    }
  }
  for (int i = 0; i < s.size() - 1; i++) {
    if (i == 0) {
      ans = min(ans, min(cnt1[s.size() - 1], cnt2[s.size() - 1]));
    } else {
      ans = min(ans, cnt2[i - 1] + cnt1[s.size() - 1] - cnt1[i - 1]);
    }
  }
  cout << ans << endl;
  return 0;
}
