#include <bits/stdc++.h>
const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e4 + 5;
using namespace std;
vector<int> v;
int main() {
  int n;
  cin >> n;
  cin.get();
  string s;
  cin >> s;
  for (int i = 0; i <= (n - 1); i++) {
    if (s[i] == '#') v.push_back(i);
  }
  if (v.empty()) return 0 * puts("0");
  int ans = 0;
  for (int i = 0; i <= ((int)v.size() - 2); i++) {
    if (v[i] != v[i + 1] - 1) ans++;
  }
  if (v.back() != n - 1) ans++;
  cout << ans << endl;
  return 0;
}
