#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  long long n;
  string s;
  cin >> n;
  cin >> s;
  long long ans = mod;
  long long white = 0, black = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') black++;
    if (s[i] == '.') white++;
  }
  long long lw = white, rb = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') rb++;
    if (s[i] == '.') lw--;
    ans = min(ans, rb + lw);
  }
  cout << ans << endl;
  ;
}
