#include <bits/stdc++.h>
using namespace std;
long long MOD = 10e9 + 7;
int main() {
  int n, count = 0, count2 = 0;
  string s, s2;
  cin >> n;
  cin >> s;
  s2 = s;
  for (int i = n - 1; i > 0; i--) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i - 1] = '.';
      count++;
    }
  }
  for (int i = n - 1; i > 0; i--) {
    if (s2[i] == '.' && s2[i - 1] == '#') {
      s2[i] = '#';
      count2++;
    }
  }
  cout << (min(count, count2)) << "\n";
  ;
  return 0;
}
