#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count1 = 0, count2 = 0;
  string a, b;
  cin >> n >> a;
  b = a;
  int q = 0;
  for (int i = 0; i < a.size() - 1; i++) {
    if (a[i] == '#' && a[i + 1] == '.') {
      a[i + 1] = '#';
      count1++;
    }
  }
  int whi1 = 0, bla1 = 0, whi2 = 0, bla2 = 0;
  for (int i = 0; i < b.size(); i++) {
    if (q <= 1) {
      if (b[i] == '#') {
        q++;
        bla1++;
        if (q == 2) bla2++;
      }
      if (b[i] == '.') {
        whi1++;
      }
    } else {
      if (b[i] == '#')
        bla2++;
      else
        whi2++;
    }
  }
  int min = whi2 > bla2 ? bla2 : whi2;
  min++;
  if (min > count1) {
    cout << count1;
  } else
    cout << min;
  return 0;
}
