#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, inf = 1e9;
int n, dp[N][2];
char s[N];
int k;
bool is[N];
int main() {
  scanf("%d%s", &n, s + 1);
  for (int i = 1; i <= n; i++) is[i] = s[i] == '.' ? 0 : 1;
  dp[0][0] = 0;
  dp[0][1] = inf;
  for (int i = 1; i <= n; i++) {
    if (is[i]) {
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][1]);
      dp[i][0] = min(dp[i - 1][0], dp[i - 1][1]) + 1;
    } else {
      dp[i][0] = dp[i - 1][0];
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][1]) + 1;
    }
  }
  cout << min(dp[n][0], dp[n][1]);
}
