#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  string s1 = s, s2 = s;
  int ans_1 = 0;
  int ans_2 = 0;
  for (int i = 0; i < N - 1; i++) {
    if (s1[i] == '#' && s1[i + 1] == '.') {
      ans_1++;
      s[i + 1] = '#';
    }
  }
  reverse(s2.begin(), s2.end());
  for (int i = 0; i < N - 1; i++) {
    if (s2[i] == '.' && s2[i + 1] == '#') {
      ans_2++;
      s[i + 1] = '.';
    }
  }
  cout << min(ans_1, ans_2) << endl;
}
