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