#include <bits/stdc++.h>
using namespace std;
long long MOD = (long long)1e9 + 7;
long long INF = (long long)2e18;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long N;
  string S;
  cin >> N >> S;
  long long endCoordinate = -1, firstCoordinate = -1;
  for (long long i = N - 1; i >= 0; i--) {
    if (S[i] == '#') {
      endCoordinate = i;
      break;
    }
  }
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') {
      firstCoordinate = i;
      break;
    }
  }
  long long ans = 1e9;
  bool check = true;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '.') check = false;
  }
  if (firstCoordinate == -1 && endCoordinate == -1) {
    cout << 0 << endl;
  } else if (firstCoordinate == 0 && endCoordinate == N - 1 && check) {
    cout << 0 << endl;
  } else {
    long long temp = 0;
    for (long long i = endCoordinate - 1; i >= 0; i--) {
      if (S[i] == '#') ++temp;
    }
    ans = min(ans, temp);
    temp = 0;
    for (long long i = firstCoordinate + 1; i <= N; ++i) {
      if (S[i] == '.') ++temp;
    }
    ans = min(ans, temp);
    cout << ans << endl;
  }
}
