#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, M, count;
  string S;
  cin >> N >> S;
  char X, Y;
  i = N - 1;
  count = 0;
  for (; i > 0;) {
    if (S.at(i) == '#') {
      break;
    }
    i--;
  }
  M = N - i - 1;
  for (int j = 0; j < i; j++) {
    if (S.at(j) == '#') {
      count++;
    }
  }
  cout << count << endl;
}
