#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S;
long long ans = 0;
int main() {
  cin >> N >> S;
  bool flag = 0;
  int br = 0, wh = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      flag = 1;
      br++;
    }
    if (flag && S[i] == '.') {
      wh++;
    }
  }
  cout << min(br, wh);
}
