#include <bits/stdc++.h>
using namespace std;
const static int MAX = 200000;
int n, c1 = 0, c2 = 0, c3 = MAX;
char S[MAX];
string s;
int main() {
  scanf("%d", &n);
  scanf("%s", S);
  s = S;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      c1++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      c2++;
    }
    c3 = min(c3, c1 - 2 * c2 + i + 1);
  }
  printf("%d\n", c3);
  return 0;
}
