#include <bits/stdc++.h>
using namespace std;
long gcd(long x, long y) {
  if (x > y) {
    return gcd(y, x);
  }
  long r;
  while (y != 0) {
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}
long lcm(long x, long y) { return (x / gcd(x, y)) * y; }
void indexsort(long* first, long* last, long* func) {
  sort(first, last, [&](long a, long b) { return func[a] < func[b]; });
}
int main() {
  long N;
  cin >> N;
  string S;
  cin >> S;
  long mycount = 0;
  long res = 9999999;
  long cres = res;
  for (int i = 0; i <= N - 1; i++)
    if (S[i] == '#') mycount++;
  res = mycount;
  cres = mycount;
  for (int i = N - 2; i >= 0; i--) {
    if (S[i + 1] == '#')
      res--;
    else
      res++;
    cres = min(cres, res);
  }
  cout << cres << endl;
}
