#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  long long n;
  string s;
  cin >> n >> s;
  long long ans = 0, memo = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') {
      memo = i;
      break;
    }
    if (i == n - 1) {
      cout << 0 << "\n";
      return 0;
    }
  }
  for (long long i = memo; i < n; i++) {
    if (s[i] == '.') ans++;
  }
  cout << ans << "\n";
  return 0;
}
