#include <bits/stdc++.h>
using namespace std;
int n, h[100005];
long long dp[100005];
int main() {
  int N, M, K;
  std::cin >> N;
  string s;
  std::cin >> s;
  int kuro, shiro;
  kuro = 0;
  shiro = 0;
  int place;
  place = 0;
  int ans;
  ans = 0;
  for (long long i = 0; i < N; i++) {
    if (i != 0) {
      if (s[i] == '.' && s[i - 1] == '#') {
        kuro++;
      }
    }
  }
  for (long long i = 0; i < N; i++) {
    if (s[i] == '#') {
      place = 1;
    } else {
      if (place == 1) {
        ans++;
      }
    }
  }
  if (kuro > ans) {
    printf("%d", ans);
  } else {
    printf("%d", kuro);
  }
  return 0;
}
