#include <bits/stdc++.h>
int main() {
  int N, ans[2] = {-1, -1};
  scanf("%d", &N);
  char isi[N];
  scanf("%s", isi);
  for (int i = 0; i < N; i++) {
    if (isi[i] == '#') ans[0] = 0;
    if (isi[i] == '.' && ans[0] >= 0) ans[0]++;
    if (isi[N - i - 1] == '.') ans[1] = 0;
    if (isi[N - i - 1] == '#' && ans[1] >= 0) ans[1]++;
  }
  if (ans[0] < 0) ans[0] = 0;
  if (ans[1] < 0) ans[1] = 0;
  if (ans[0] > ans[1])
    printf("%d\n", ans[1]);
  else
    printf("%d\n", ans[0]);
}
