#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  vector<long long> white(N, 0), black(N, 0);
  if (s[0] == '#')
    black[0] = 1;
  else
    white[0] = 1;
  for (int i = 1; i < N; i++) {
    if (s[i] == '.') {
      white[i] = white[i - 1] + 1;
      black[i] = black[i - 1];
    } else {
      white[i] = white[i - 1];
      black[i] = black[i - 1] + 1;
    }
  }
  long long ans = 10000000;
  for (int i = 0; i < N; i++) {
    long long tmp = black[i] + (white[N - 1] - white[i]);
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}
