#include <bits/stdc++.h>
using namespace std;
void mmin(long long &a, long long b) { a = min(a, b); }
void mmax(long long &a, long long b) { a = max(a, b); }
signed main() {
  long long pr = 1000;
  pr *= pr * pr;
  pr += 7;
  long long N;
  string S;
  cin >> N;
  cin >> S;
  long long min_value = N;
  long long left_dis = 0, right_dis = 0;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '.') right_dis++;
  }
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') {
      left_dis++;
    } else {
      right_dis--;
    }
    long long dis = left_dis + right_dis;
    if (min_value > dis) min_value = dis;
  }
  cout << min_value;
  return 0;
}
