#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long ans = 0, flag = 1;
  char ch;
  while ((ch = getchar()) < '0' || ch > '9')
    if (ch == '-') flag = -1;
  ans = ch ^ 48;
  while ((ch = getchar()) >= '0' && ch <= '9')
    ans = (ans << 3) + (ans << 1) + (ch ^ 48);
  return flag * ans;
}
int n;
char buff[200005];
int dp[200005][2];
int main() {
  cin >> n;
  scanf("%s", buff);
  int wc = 0, bc = 0, fb = 99999999;
  for (register int i = 0; i < n; i++) {
    if (buff[i] == '#') {
      bc++;
      fb = min(fb, i);
    } else
      wc++;
  }
  int nedd1 = 0;
  for (register int i = fb; i < n; i++) {
    if (buff[i] == '.') nedd1++;
  }
  cout << min(nedd1, bc);
  return 0;
}
