#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-6;
char S[200005];
int main() {
  { ; };
  { ; };
  int N;
  scanf("%d %s", &N, S);
  int res = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') {
      for (int j = i - 1; j >= 0; j--) {
        if (S[j] == '#') res++;
      }
      break;
    }
  }
  printf("%d\n", res);
  return 0;
}
