#include <bits/stdc++.h>
using namespace std;
int n, cnt, ans;
string s;
int main() {
  cin >> n >> s;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '#') {
      cnt++;
    } else {
      break;
    }
  }
  for (int i = 0; i <= s.size() - cnt; i++) {
    if (s[i] == '#') {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
