#include <bits/stdc++.h>
using namespace std;
int white[200010];
long long dp[50][2] = {0};
int main(void) {
  long long n;
  string s;
  cin >> n >> s;
  int left = 0, right = n - 1, num = 0, ans = 0;
  white[0] = 0;
  for (int i = 0; i < n; i++) {
    white[i + 1] = white[i];
    if (s[i] == '.') white[i + 1]++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      left = i + 1;
      break;
    } else {
      if (i == n - 1) left = i + 1;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      right = i + 1;
      break;
    } else {
      if (i == 0) right = i + 1;
    }
  }
  if (left >= right)
    cout << ans << endl;
  else {
    ans = n;
    for (int i = left; i <= right; i++) {
      int x = i - (white[i] - white[left - 1]);
      int y = white[right] - white[i];
      num = x + y;
      ans = min(ans, num);
    }
    cout << ans << endl;
  }
}
