#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  uint64_t n;
  string s;
  cin >> n >> s;
  bool count = false;
  uint64_t res = 0;
  for (uint64_t i = 0; i < n; ++i) {
    if (count) {
      if (s[i] == '.') {
        ++res;
      }
    } else {
      if (s[i] == '#' && (i > 0 && s[i - 1] == '.')) {
        count = true;
        ++res;
      }
    }
  }
  cout << res << endl;
  return 0;
}
