#include <bits/stdc++.h>
int main() {
  int n;
  std::string s;
  std::cin >> n;
  std::cin >> s;
  int dp[100010][2] = {};
  if (s[0] == '#') dp[0][0] = 1;
  if (s[n - 1] == '.') dp[n - 1][1] = 1;
  for (int i = 1; i < n; i++) {
    dp[i][0] = dp[i - 1][0];
    if (s[i] == '#') dp[i][0]++;
  }
  for (int i = n - 2; i >= 0; i--) {
    dp[i][1] = dp[i + 1][1];
    if (s[i] == '.') {
      dp[i][1]++;
    }
  }
  int ans = dp[0][1];
  for (int i = 0; i < n; i++) ans = std::min(ans, dp[i][0] + dp[i + 1][1]);
  std::cout << ans << std::endl;
  return 0;
}
