#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  int b[N + 1], w[N + 1];
  string S;
  cin >> S;
  b[0] = 0;
  w[0] = 0;
  for (int i = 1; i < N + 1; i++) {
    b[i] = b[i - 1];
    w[i] = w[i - 1];
    if (S[i - 1] == '#')
      b[i]++;
    else
      w[i]++;
  }
  int ans = INT32_MAX;
  for (int i = 0; i < N + 1; i++) {
    ans = min(b[i] + w[N] - w[i], ans);
  }
  cout << ans;
  return 0;
}