#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int M = N - 1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      M = i;
      break;
    }
  }
  if (M == N - 1) {
    cout << 0 << endl;
  } else {
    int a = 0;
    int L = N - 1;
    for (int i = M; i < N; i++) {
      if (S[i] == '.') {
        L = i;
        break;
      } else
        a++;
    }
    int b = 0;
    for (int i = L; i < N; i++) {
      if (S[i] == '.') {
        b++;
      }
    }
    cout << min(a, b) << endl;
  }
}
