#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
int main(int argc, char const* argv[]) {
  int n;
  string s;
  cin >> n >> s;
  vector<string> t(3);
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i < (n); ++i) {
    t[0].push_back('.');
  }
  t[0].push_back('#');
  for (int i = 0; i < (n); ++i) {
    t[1].push_back('.');
  }
  for (int i = 0; i < (n); ++i) {
    t[2].push_back('#');
  }
  long long ans = INF;
  for (int i = 0; i < (3); ++i) {
    long long tmp = 0;
    for (int j = 0; j < (n); ++j) {
      if (s[j] != t[i][j]) {
        tmp++;
      }
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
