#include <bits/stdc++.h>
using namespace std;
long long N;
string S;
long long i = 0;
long long cnt_b;
long long cnt_w;
long long ans = 0;
long long ans2 = 0;
int main() {
  cin >> N;
  cin >> S;
  cnt_b = 0;
  cnt_w = 0;
  while (i < N) {
    while (S[i] == '#' && i < N) {
      cnt_b++;
      i++;
      if (i == N) break;
      while (S[i] == '.') {
        cnt_w++;
        i++;
        if (i == N) break;
      }
    }
    i++;
  }
  reverse(S.begin(), S.end());
  int j = 0;
  while (S[j] == '#' && j < N) {
    cnt_b--;
    j++;
  }
  cout << min(cnt_b, cnt_w) << endl;
}
