#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  char s[N];
  scanf("%s", s);
  int count = 0, ans = 0, flag = 0, bla = 0, whi = 0;
  while (count < N) {
    if (s[count] == '#') flag = 1;
    if (flag == 1 && s[count] == '.') ans++;
    if (s[count] == '#') bla++;
    if (s[count] == '.') whi++;
    count++;
  }
  if (bla < ans) ans = bla;
  if (whi < ans) ans = whi;
  printf("%d", ans);
  return 0;
}
