#include <bits/stdc++.h>
using namespace std;
char c[500005];
int sum[500005], n, p;
int main(void) {
  scanf("%d", &n);
  scanf("%s", c);
  sum[0] = (c[0] == '#');
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + (c[i] == '#');
  printf("%d", max(0, sum[n - 1] - 1));
}
