#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  if (N == 1) {
    cout << 0 << endl;
    return 0;
  }
  int sum = 0;
  for (long long i = 0; i < N - 1; ++i) {
    if (S.at(i) == S.at(i + 1)) {
      sum++;
    }
  }
  if (sum == N - 1) {
    cout << 0 << endl;
    return 0;
  }
  int ans = 0;
  int K = 0;
  for (int i = 0; i < N; ++i) {
    if (S.at(i) == '#') {
      K++;
    }
  }
  int J = 0;
  J = min(K, (N - K));
  if (S.at(0) != '.') {
    ans++;
    S.at(0) = '.';
  }
  if (S.at(N - 1) != '#') {
    ans++;
    S.at(N - 1) = '#';
  }
  int a = 0, b = 0;
  for (long long i = 0; i < N; ++i) {
    if (S.at(i) == '.') {
      a++;
    } else {
      break;
    }
  }
  for (long long i = 0; i < N; ++i) {
    if (S.at(N - i - 1) == '#') {
      b++;
    } else {
      break;
    }
  }
  int A = 0;
  for (int i = a; i < N - b; i++) {
    if (S.at(i) == '.') {
      A++;
    }
  }
  if (A <= (N - a - b - A)) {
    ans += A;
  } else {
    ans += (N - a - b - A);
  }
  cout << min(ans, J) << endl;
}
