#include <bits/stdc++.h>
using namespace std;
int okikae(int N, string S) {
  string sa, sb;
  int a, b, c;
  a = N + 1;
  b = N + 1;
  string ta, tb;
  for (int i = 0; i < N; i++) {
    ta = S[i];
    if (ta != ".") {
      a = i;
      break;
    }
  }
  for (int j = 0; j < N; j++) {
    tb = S[N - 1 - j];
    if (tb != "#") {
      b = j;
      break;
    }
  }
  if (a == N + 1 || b == N + 1) {
    c = 0;
  } else if (a == N - b) {
    c = 0;
  } else {
    sa = S;
    sb = S;
    sa.replace(a, 1, ".");
    sb.replace(N - 1 - b, 1, "#");
    c = min(okikae(N, sa), okikae(N, sb)) + 1;
  }
  return c;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  int a;
  a = okikae(N, S);
  cout << a;
  return 0;
}
