#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char a;
  int ans, flag = 0;
  cin >> n;
  while (n--) {
    cin >> a;
    if (a == '#') flag = 1;
    if (flag)
      if (a == '.') ans++;
  }
  cout << ans;
  return 0;
}
