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