#include <bits/stdc++.h>
using namespace std;
long long int conv(char c) {
  if (c == '#') return 1;
  return 0;
}
long long int solve(long long int n, long long int k,
                    vector<vector<long long int>>& dp, string& s) {
  if (dp[n][k] != -1) return dp[n][k];
  if (n == 0) {
    dp[n][k] = 0;
    return dp[n][k];
  }
  if (k == conv('#')) {
    dp[n][k] = solve(n - 1, conv(s[n - 1]), dp, s);
    return dp[n][k];
  }
  if (conv(s[n - 1]) == conv('.')) {
    dp[n][k] = solve(n - 1, conv(s[n - 1]), dp, s);
    return dp[n][k];
  }
  long long int r1 = solve(n - 1, conv('.'), dp, s);
  long long int r2 = solve(n - 1, conv('#'), dp, s) + 1;
  if (conv('.') == conv(s[n - 1]))
    r2++;
  else
    r1++;
  dp[n][k] = min(r1, r2);
  return dp[n][k];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  vector<vector<long long int>> dp(n, vector<long long int>(2, -1));
  cout << solve(n - 1, conv(s[n - 1]), dp, s) << '\n';
  return 0;
}
