#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int inf = 1e6;
  vector<vector<int>> dp(n, vector<int>(2, inf));
  for (int i = 0; i < n; ++i) {
    char t;
    cin >> t;
    int k;
    if (t == '#')
      k = 1;
    else
      k = 0;
    if (i == 0) {
      dp[i][k] = 0;
      dp[i][(k + 1) % 2] = 1;
    } else if (k == 1) {
      dp[i][1] = min(dp[i - 1][1], dp[i - 1][0]);
      dp[i][0] = min(dp[i - 1][1] + 1, dp[i - 1][0]) + 1;
    } else {
      dp[i][1] = min(dp[i - 1][1], dp[i - 1][0]) + 1;
      dp[i][0] = min(dp[i - 1][1] + 1, dp[i - 1][0]);
    }
  }
  cout << min(dp[n - 1][1], dp[n - 1][0]);
  return 0;
}
