#include <bits/stdc++.h>
using namespace std;
long long i, j;
const long long mod = 1000000007;
const double pi = acos(-1);
long long cei(long long x, long long y) {
  long long ans = x / y;
  if (x % y != 0) ans++;
  return ans;
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long llpow(long long x, long long n) {
  long long ans = 1;
  for ((i) = (0); (i) < (n); (i)++) {
    ans *= x;
  }
  return ans;
}
long long fact(long long x) {
  long long ans = 1;
  for ((i) = (0); (i) < (x); (i)++) ans *= (x - i);
  return ans;
}
long long ncr(long long n, long long r) {
  return fact(n) * fact(n - r) / fact(r);
}
long long npr(long long n, long long r) { return fact(n) / fact(n - r); }
bool prime(long long a) {
  if (a <= 1) return false;
  for (i = 2; i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
long long fib(long long x) {
  long long fibo[x + 10];
  fibo[0] = 1;
  fibo[1] = 1;
  fibo[2] = 1;
  for ((i) = (3); (i) < (x + 1); (i)++) fibo[i] = fibo[i - 1] + fibo[i - 2];
  return fibo[x];
}
long long dig(long long n) {
  long long d = 1, tmp = n;
  while (tmp / 10 > 0) {
    tmp /= 10;
    d++;
  }
  return d;
}
void matcpy(long long a[21][21], long long b[21][21]) {
  long long t = i;
  for ((i) = (0); (i) < (21); (i)++)
    for ((j) = (0); (j) < (21); (j)++) b[i][j] = a[i][j];
  i = t;
}
void matrst(long long a[21][21]) {
  long long t = i;
  for ((i) = (0); (i) < (21); (i)++)
    for ((j) = (0); (j) < (21); (j)++) a[i][j] = 0;
  i = t;
}
void matpow(long long a[21][21]) {
  long long ans[21][21];
  matrst(ans);
  long long t = i, k;
  for ((i) = (0); (i) < (21); (i)++)
    for ((j) = (0); (j) < (21); (j)++)
      for ((k) = (0); (k) < (21); (k)++) ans[i][j] += a[i][k] * a[k][j];
  matcpy(ans, a);
  i = t;
}
void matmul(long long a[21][21], long long b[21][21], long long as[21][21]) {
  long long t = i, k;
  matrst(as);
  for ((i) = (0); (i) < (21); (i)++)
    for ((j) = (0); (j) < (21); (j)++)
      for ((k) = (0); (k) < (21); (k)++) as[i][j] += a[i][k] * b[k][j];
  i = t;
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long w = 0, b = 0, c1, c2;
  for ((i) = (0); (i) < (n); (i)++) {
    if (s[i] == '.')
      w++;
    else
      b++;
  }
  c1 = b;
  for ((i) = (n)-1; (i) >= (0); (i)--) {
    if (s[i] == '.') break;
    c1--;
  }
  c2 = w;
  for ((i) = (0); (i) < (n); (i)++) {
    if (s[i] == '#') break;
    c2--;
  }
  cout << min(c1, c2) << endl;
  return 0;
}
