#include <bits/stdc++.h>
using namespace std;
const long long ZERO = 0;
const long long INF = 1e14;
const long long MOD = 1000000007;
const double PI = 3.1415926535897;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ret = 0;
  for (int i = N - 1; i > 0; i--) {
    if (S.at(i) == '.' && S.at(i - 1) == '#') {
      ret++;
    }
  }
  cout << ret << endl;
}
