#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
int sum[100001];
int main() {
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; ++i) {
    sum[i + 1] = sum[i];
    if (s[i] == '#') {
      ++sum[i + 1];
    }
  }
  int ans = INF;
  for (int i = 0; i <= n; ++i) {
    int cnt = 0;
    cnt += sum[i];
    cnt += n - i - (sum[n] - sum[i]);
    ans = min(ans, cnt);
  }
  cout << ans << endl;
}
