#include <bits/stdc++.h>
static int N;
static char S[200001];
int search(int i, int X, char P) {
  if (i == N) return X;
  int Ret = 0;
  if (P == '#' && S[i] == '.') {
    int Ret0 = search(i + 1, X + 1, '.');
    int Ret1 = search(i + 1, X + 1, '#');
    Ret = (Ret0 > Ret1) ? Ret1 : Ret0;
  } else {
    Ret = search(i + 1, X, S[i]);
  }
  return Ret;
}
int main(void) {
  scanf("%d", &N);
  scanf("%s", S);
  int X = search(1, 0, S[0]);
  printf("%d\n", X);
  return 0;
}
