#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, ans1 = 0, ans2 = 0;
  cin >> n >> s;
  string s1, s2;
  s1 = s;
  s2 = s;
  for (int i = n; i > 0; i--) {
    if (s1[i] == '.' && s1[i - 1] == '#') {
      ans1++;
      s1[i - 1] = '.';
    }
  }
  for (int i = 0; i < n - 1; i++) {
    if (s2[i] == '#' && s2[i + 1] == '.') {
      ans2++;
      s2[i + 1] = '#';
    }
  }
  cout << min(ans1, ans2);
}
