#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const long long int INFl = 9223372036854775807;
const int MAX = 10000;
const long long int MOD = 1000000007;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int n;
char s[200100];
int main() {
  cin >> n;
  int b = 0;
  int w = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == '.')
      w++;
    else
      b++;
  }
  int sb[n];
  int sw[n];
  if (s[0] == '.') {
    sb[0] = 0;
    sw[0] = w;
  } else {
    sb[0] = 0;
    sw[0] = w;
  }
  for (int i = 1; i < n; i++) {
    if (s[i - 1] == '#') {
      sb[i] = sb[i - 1] + 1;
    } else {
      sb[i] = sb[i - 1];
    }
    if (s[i] == '.') {
      sw[i] = sw[i - 1] - 1;
    } else {
      sw[i] = sw[i - 1];
    }
  }
  int ans = ((b) < (w) ? (b) : (w));
  for (int i = 0; i < n; i++)
    ans = ((ans) < (sw[i] + sb[i]) ? (ans) : (sw[i] + sb[i]));
  cout << ans << endl;
  return 0;
}
