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