#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
signed main() {
  long long N;
  string S;
  cin >> N >> S;
  long long ans[N + 10][3];
  ans[0][0] = 0;
  ans[0][1] = 0;
  for (long long i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      ans[i + 1][0] = min(ans[i][0] + 1, ans[i][1] + 1);
      ans[i + 1][1] = min(ans[i][0], ans[i][1]);
    } else {
      ans[i + 1][0] = ans[i][0];
      ans[i + 1][1] = min(ans[i][0] + 1, ans[i][1] + 1);
    }
  }
  cout << min(ans[N][0], ans[N][1]) << endl;
  return 0;
}
