#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, m, l, f, x, y, z;
  string s;
  cin >> n >> s;
  int sum1 = 0;
  int sum2 = 0;
  int sum3 = 0;
  int sum4 = 0;
  f = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') f = 1;
    if (f == 0) continue;
    if (s[i] == '.') sum1++;
  }
  f = 0;
  for (i = 0; i < n; i++) {
    if (s[n - 1 - i] == '.') f = 1;
    if (f == 0) continue;
    if (s[n - 1 - i] == '#') sum2++;
  }
  for (i = 0; i < n; i++) {
    if (s[i] == '#') sum3++;
    if (s[i] == '.') sum4++;
  }
  int ans = 10000000;
  ans = min(sum1, sum2);
  ans = min(ans, sum3);
  ans = min(ans, sum4);
  cout << ans << endl;
}
