#include <bits/stdc++.h>
using namespace std;
const long long mo = 1000000007;
long long ans = 0;
long long dp[0][0];
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  bool a = 0;
  for (long long i = 0; i < (long long)(n); i++) {
    if (s[i] == '#') a = 1;
    if (a && s[i] != '#') ans++;
  }
  cout << ans << endl;
  return 0;
}
