#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char s[2001];
  cin >> n >> s;
  int a[2001 + 1], b[2001 + 1];
  memset(a, 0, (n + 1) * sizeof(int));
  memset(b, 0, (n + 1) * sizeof(int));
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      b[i + 1] = b[i] + 1;
    else
      b[i + 1] = b[i];
  }
  for (int i = n - 1; i >= 0; i--)
    if (s[i] == '.')
      a[n - i] = a[n - 1 - i] + 1;
    else
      a[n - i] = a[n - 1 - i];
  int ans = 2001 + 1;
  for (int i = 0; i <= n; i++) ans = min(ans, b[i] + a[n - i]);
  cout << ans;
  return 0;
}
