#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
template <class T, class C>
void chmax(T& a, C b) {
  a > b ?: a = b;
}
template <class T, class C>
void chmin(T& a, C b) {
  a < b ?: a = b;
}
int main(int argc, char* argv[]) {
  int n;
  string s;
  cin >> n >> s;
  int flag = 0;
  int ans = 0;
  int flag2;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#') flag = 1;
    if (flag == 1) {
      if (s[i + 1] == '.') {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
