#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using ll = long long;
using ld = long double;
const int maxn = 2e5 + 100;
int dp[maxn][2];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == '.') {
      dp[i][0] = dp[i - 1][0];
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][1]) + 1;
    } else {
      dp[i][1] = dp[i - 1][1];
      dp[i][0] = min(dp[i - 1][0], dp[i - 1][1]) + 1;
    }
  }
  cout << min(dp[n][0], dp[n][1]);
  return 0;
}
