#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to, cost;
};
const long long INF = 100000000000000000;
const long long INF2 = 9223372036854775807;
const long long MOD = 1000000007;
long long N;
string S;
signed main() {
  cin >> N >> S;
  long long sum = 0, sum2 = 0;
  for (long long i = 0; i < (long long)(S.size()); i++) {
    if (S[i] == '#') {
      sum++;
    } else {
      sum2++;
    }
  }
  long long cnt = 0, cnt2 = 0;
  long long ans = INF;
  for (long long i = 0; i < (long long)(S.size()); i++) {
    if (S[i] == '#') {
      cnt++;
    } else if (S[i] == '.') {
      cnt2++;
    }
    ans = (((long long)(cnt + sum2 - cnt2) < (long long)(ans))
               ? (cnt + sum2 - cnt2)
               : (ans));
  }
  ans = (((long long)(sum) < (long long)(ans)) ? (sum) : (ans));
  cout << ans << endl;
  return 0;
}
