#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
  }
  int n;
  cin >> n;
  string s;
  cin >> s;
  int dp[n];
  for (int i = 1; i <= n - 1; i++) dp[i] = 1e9;
  dp[0] = 0;
  for (int i = 1; i <= n - 1; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      dp[i] = min(dp[i - 1] + 1, dp[i]);
    } else
      dp[i] = dp[i - 1];
  }
  cout << dp[n - 1];
  return 0;
}
