#include <bits/stdc++.h>
using namespace std;
long long GCD(long long A, long long B) {
  if (B == 0) {
    return A;
  } else {
    return GCD(B, A % B);
  }
}
long long LCM(long long A, long long B) {
  long long g = GCD(A, B);
  return A / g * B;
}
long long num_order(long long X) {
  long long ans = 0;
  while (true) {
    if (X == 0) {
      break;
    } else {
      X /= 10;
      ans++;
    }
  }
  return ans;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  int appear = 1000000000;
  long long app_white = 0;
  long long app_black = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      appear = i;
      break;
    }
  }
  for (int i = appear; i < N; i++) {
    if (S[i] == '.') {
      app_white++;
    } else {
      app_black++;
    }
  }
  cout << min(app_white, app_black);
}
