#include <bits/stdc++.h>
using namespace std;
int A, B, C, D, N, M;
string in;
int main() {
  ios::sync_with_stdio(false);
  cin >> N;
  cin >> in;
  string cp = in;
  int x = 0;
  int y = 0;
  for (int i = 0; i < N - 1; i++) {
    if (in[i] == '#' && in[i + 1] == '.') {
      in[i + 1] = '#';
      x++;
    }
  }
  for (int i = N - 1; i > 0; i--) {
    if (cp[i] == '.' && cp[i - 1] == '#') {
      cp[i - 1] = '.';
      y++;
    }
  }
  cout << min(x, y);
  return 0;
}
