#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
char s[maxn];
int main() {
  int n;
  scanf("%d\n", &n);
  int ret = 0;
  int pos = 0;
  int numa = 0, numb = 0;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%c", &s[i]);
    if (s[i] == '.') {
      pos = i;
    }
  }
  for (int i = 1; i <= pos; i++) {
    if (s[i] == '#') {
      numa++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i] = '#';
      ret++;
    }
  }
  ans = min(ret, numa);
  printf("%d\n", ans);
}
