#include <bits/stdc++.h>
using namespace std;
void solve(long long N, std::string S) {
  string copy = S;
  int ans = 40000000;
  int cnt = 0;
  int odd = 0;
  bool flag = true;
  int sharp = 0;
  int dot = 0;
  if (S[0] == '#') {
    flag = true;
  } else {
    flag = false;
  }
  for (int i = 0; i < N; i++) {
    if (flag) {
      if (S[i] == '#') {
        sharp++;
      } else {
        flag = false;
        dot++;
      }
    } else {
      if (S[i] == '#') {
        if (odd % 2 == 0) {
          cnt += sharp;
        } else {
          cnt += dot;
        }
        sharp = 1;
        dot = 0;
        flag = true;
      } else {
        dot++;
      }
    }
  }
  cnt += min(sharp, dot);
  cout << cnt << endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::string S;
  std::cin >> S;
  solve(N, S);
  return 0;
}
