#include <bits/stdc++.h>
using namespace std;
long long dp[200005][3];
signed main() {
  long long n, k;
  string s = "0", t;
  cin >> n >> t;
  s += t;
  for (long long i = 1; i <= n; i++) {
    dp[i][1] = min(dp[i - 1][0], dp[i - 1][1]) + (s[i] == '.');
    dp[i][0] = min(dp[i - 1][1] + 1, dp[i - 1][0]) + (s[i] == '#');
  }
  cout << min(dp[n][1], dp[n][0]);
}
