#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int Dot = 0, Sharp = 0;
  int m1 = 0, M1 = 0;
  bool flag_for_1st_group = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == '#') {
      Sharp++;
    } else {
      Dot++;
    }
    if (i > 1 && s.at(i) == '.' && s.at(i - 1) == '#' &&
        flag_for_1st_group == 0) {
      m1 = i + 1 - M1;
      flag_for_1st_group = 1;
    }
    if (i > 1 && s.at(i) == '#' && s.at(i - 1) == '.' &&
        flag_for_1st_group == 0) {
      M1 = i + 1;
    }
  }
  int ans;
  if (M1) {
    ans = min(Sharp, min(Dot, M1 - m1 + Dot));
  } else {
    ans = min(Sharp, Dot - m1);
  }
  cout << ans;
}
