#include <bits/stdc++.h>
char *copy(char *str, int len) {
  char *p = (char *)malloc((len + 100) * sizeof(char));
  int i;
  for (i = 0; i < len; ++i) {
    p[i] = str[i];
  }
  p[len] = '\0';
  return p;
}
int cnt_black(char *str, int len) {
  int cnt = 0, i;
  int flag = 1;
  while (flag == 1) {
    flag = 0;
    for (i = 1; i < len; ++i) {
      if (str[i - 1] == '#' && str[i] == '.') {
        ++cnt;
        str[i] = '#';
        flag = 1;
      }
    }
  }
  return cnt;
}
int cnt_white(char *str, int len) {
  int cnt = 0, i;
  for (i = len - 2; i >= 0; --i) {
    if (str[i] == '#' && str[i + 1] == '.') {
      ++cnt;
      str[i] = '.';
    }
  }
  return cnt;
}
void solve(int len, char *str) {
  char *str2 = copy(str, len);
  int cnt1 = cnt_black(str, len);
  int cnt2 = cnt_white(str2, len);
  printf("%d\n", (cnt1 < cnt2) ? cnt1 : cnt2);
}
int main() {
  int n;
  scanf("%d", &n);
  char *str = (char *)malloc((n + 100) * sizeof(char));
  scanf("%s", str);
  solve(n, str);
  return 0;
}
