#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const long long MOD = 1000000007;
const long long INF = 1e10;
const long long MAX_N = 1010;
long long fac[MAX_N], finv[MAX_N], inv[MAX_N];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX_N; i++) {
    fac[i] = fac[i - 1] * i;
  }
}
long long COM(long long n, long long k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  if (n > k * 2) {
  }
  return fac[n] / (fac[k] * fac[n - k]);
}
long long dp[201010][2];
long long dx[4] = {0, 0, -1, 1};
long long dy[4] = {-1, 1, 0, 0};
char c[10][10];
bool flag[10][10];
bool flag2[10][10];
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long res = 0;
  long long res2 = 0;
  long long white = INF;
  long long black = INF;
  for (long long i = 0; i < n; ++i) {
    if (s[n - 1 - i] == '.' && white == INF) white = n - 1 - i;
    if (s[i] == '#' && black == INF) black = i;
  }
  for (long long i = black; i < n; ++i) {
    if (s[i] == '.') res++;
  }
  for (long long i = 0; i < white; ++i) {
    if (s[i] == '#') res2++;
  }
  long long ans = min(res, res2);
  cout << ans << endl;
  return 0;
}
