#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
long long lcg(long long x, long long y) { return x * y / gcd(x, y); }
map<long long, long long> factor(long long n) {
  map<long long, long long> ans;
  long long a = 2;
  while (n >= a * a) {
    if (n % a == 0) {
      ans[a]++;
      n /= a;
    } else
      a++;
  }
  ans[n]++;
  return ans;
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 1e6;
  for (int i = 0; i < (int)(n + 1); i++) {
    int temp = 0;
    for (int k = 0; k < (int)(n); k++) {
      if (k < i)
        if (s[k] == '#')
          temp++;
        else {
          if (s[k] == '.') temp++;
        }
    }
    if (temp < ans) ans = temp;
  }
  cout << ans << endl;
}
