#include <bits/stdc++.h>
using namespace std;
long long INF = 1 << 29;
int main() {
  ios::sync_with_stdio(false);
  int n, ans = 0, black = 0;
  string s;
  cin >> n >> s;
  int idx = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      idx = i;
      break;
    }
  }
  if (idx == -1) {
    cout << 0;
    return 0;
  }
  for (int i = idx; i < n; i++) {
    if (s[i] == '#') black++;
  }
  black--;
  ans = s.length() - (idx + 1);
  cout << ans - black << endl;
  return 0;
}
