#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, count = 0, flag = 0;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '#')
      flag = 1;
    else if (flag)
      count++;
  }
  cout << count << "\n";
  return 0;
}
