#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans1 = 0, ans2 = 0, idx1 = -1, idx2 = -1;
  char s[200001];
  cin >> n;
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &s[i]);
    if (s[i] == '#' && idx1 == -1) idx1 = i;
    if (idx1 != -1 && s[i] == '.') ans1++;
  }
  cout << ans1;
  return 0;
}
