#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int flag = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (flag == 0 && s[i] == '#') flag = 1;
    if (flag == 1 && s[i] == '.') ans++;
  }
  cout << ans << endl;
}
