#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll memo[2][200001];
int main() {
  ll N;
  string S;
  cin >> N >> S;
  int black = -1;
  int white = -1;
  for (int i = 0; i < N; ++i) {
    if (black == -1 && i != 0 && S[i] == '.' && S[i - 1] == '#') black = i - 1;
    if (i != 0 && S[i] == '.' && S[i - 1] == '#') white = i;
    memo[0][i] = -1;
    memo[1][i] = -1;
  }
  if (white == -1) {
    cout << 0 << endl;
    return 0;
  }
  ll ret1 = 0, ret2 = 0;
  for (int j = 0; j < N; ++j) {
    if (j < white && S[j] == '#') {
      ret1++;
      memo[0][j] = ret1;
    }
  }
  for (int j = N - 1; j >= 0; --j) {
    if (j > black && S[j] == '.') {
      ret2++;
      memo[1][j] = ret2;
    }
  }
  ll m = min(ret1, ret2);
  for (int k = 0; k < N; ++k) {
    if (memo[0][k] != -1 && memo[1][k] != -1)
      m = min(m, memo[0][k] + memo[1][k]);
  }
  cout << m << endl;
}
