#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n;
  cin >> s;
  int white = 0;
  int black = 0;
  int left = 0;
  int len = s.size();
  for (int i = 0; i < len; i++) {
    if (s[i] == '.') {
      white++;
      left = black;
    } else if (s[i] == '#') {
      if ((i > 0) && (s[i - 1] == '.')) {
        left = min(black, white);
      }
      black++;
    }
  }
  int ans = min({white, black, left});
  cout << ans << endl;
  return 0;
}
