#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
const long long LINF = 1e18 + 100;
const int MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ;
  int N;
  string S;
  cin >> N >> S;
  long long ans = INF;
  long long wsum = 0;
  for (int i = 0; i < (N); i++) {
    if (S[i] == '.') wsum++;
  }
  long long bsum = 0;
  for (int i = 0; i < (N); i++) {
    if (S[i] == '#')
      bsum++;
    else
      wsum--;
    ans = min(ans, wsum + bsum);
  }
  cout << ans << endl;
}
