#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  string S, SS, A, B;
  cin >> N >> SS;
  S = SS;
  A = S;
  B = S;
  long long ans = 0, cnt = 0, anss = 0;
  for (long long i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      ans++;
      S[i + 1] = '#';
    }
  }
  for (long long i = 0; i < N - 1; i++) {
    if (A[i] == '#' && A[i + 1] == '.') {
      anss++;
      A[i] = '.';
    }
  }
  ans = min(ans, anss);
  anss = 0;
  for (long long j = 0; j < N; j++) {
    for (long long i = N - 1; i >= 1; i--) {
      if (SS[i - 1] == '#' && SS[i] == '.') {
        cnt++;
        SS[i] = '#';
      }
    }
  }
  for (long long j = 0; j < N; j++) {
    for (long long i = N - 1; i >= 1; i--) {
      if (B[i - 1] == '#' && B[i] == '.') {
        anss++;
        B[i - 1] = '.';
      }
    }
  }
  cnt = min(cnt, anss);
  cout << min(ans, cnt) << endl;
  return 0;
}
