#include <bits/stdc++.h>
using namespace std;
bool check(int n, char c) {
  if ((n == 0 and c == '.') or (n == 1 and c == '#')) return true;
  return false;
}
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int now = 0;
  int cnt = 0;
  vector<int> stones;
  for (int i = 0; i < N; ++i) {
    if (check(now, S[i])) {
      cnt++;
    } else {
      stones.push_back(cnt);
      cnt = 1;
      now = 1 - now;
    }
  }
  stones.push_back(cnt);
  if (stones.size() % 2 == 0) stones.push_back(0);
  int ans = 1000000007;
  for (int i = 0; i < 2; ++i) {
    int tmp = 0;
    for (int j = i; j < stones.size(); j += 2) {
      tmp += stones[j];
    }
    if (i == 1) {
      if (stones.back() == 0) tmp -= stones[stones.size() - 2];
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
