#include <bits/stdc++.h>
using namespace std;
void solve() {
  bool flag = 0;
  int n, ans = 0;
  string s;
  cin >> n >> s;
  for (long long i = (0); i < (n); i++) {
    if (flag == 1 && s[i] == '.') {
      ans++;
    } else if (s[i] == '#')
      flag = 1;
  }
  cout << ans << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
