#include <bits/stdc++.h>
using namespace std;
void showIntArray(int a[], int n) {
  for (int i = 0; i < n; i++) {
    cout << a[i] << ' ';
  }
  cout << endl;
}
int main() {
  long long int N, count = 0, count2 = 0;
  char s[200000];
  char prec, c, prec2, c2;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> s[i];
  }
  prec = s[0];
  for (int i = 1; i < N; i++) {
    c = s[i];
    if (prec == '#' && c == '.') {
      c = '#';
      count++;
    }
    prec = c;
  }
  c = s[N];
  for (int i = N - 1; i >= 0; i--) {
    prec = s[i];
    if (prec == '#' && c == '.') {
      prec = '.';
      count2++;
    }
    c = prec;
  }
  cout << min(count, count2) << endl;
  return 0;
}
