#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
long long int mpow(long long int N, long long int P, long long int M) {
  if (P == 0) return 1;
  if (P % 2 == 0) {
    long long int t = mpow(N, P / 2, M);
    return t * t % M;
  }
  return N * mpow(N, P - 1, M) % M;
}
long long int counter(long long int x) {
  if (x == 0) return 0;
  return counter(x >> 1) + (x & 1);
}
vector<bool> prime(100 + 1, true);
void prime_table(void) {
  prime[0] = false;
  prime[1] = false;
  for (long long int i = 2; i * i <= 100; i++) {
    if (!prime[i]) {
      continue;
    }
    for (long long int j = i + i; j <= 100; j += j + i) {
      prime[j] = false;
    }
  }
}
bool IsPrime(long long int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (long long int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
signed main() {
  long long int N;
  string S;
  cin >> N >> S;
  bool w = false;
  long long int white = 0;
  for (long long int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') {
      w = true;
    }
    if (w && S[i] == '#') {
      white++;
    }
  }
  bool b = false;
  long long int black = 0;
  for (long long int i = 0; i < N; i++) {
    if (S[i] == '#') {
      b = true;
    }
    if (w && S[i] == '.') {
      black++;
    }
  }
  cout << min(white, black) << endl;
}
