#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-6;
char S[200005];
int main() {
  { ; };
  { ; };
  int N;
  scanf("%d %s", &N, S);
  int res1 = 0;
  for (int i = 0; i < N; i++)
    if (S[i] == '#') {
      for (int j = i + 1; j < N; j++)
        if (S[j] == '.') res1++;
      break;
    }
  int res2 = 0;
  for (int i = N - 1; i >= 0; i--)
    if (S[i] == '.') {
      for (int j = i - 1; j >= 0; j--)
        if (S[j] == '#') res2++;
      break;
    }
  printf("%d\n", min(res1, res2));
  return 0;
}
