#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
int main() {
  int n;
  char ch[100010];
  int a[100010], b[100010];
  n = read();
  int flag = 0;
  scanf("%s", ch + 1);
  int ans = 999999;
  for (int i = 1; i <= n; i++) {
    b[i] = b[i - 1];
    if (ch[i] == '#') b[i]++;
  }
  for (int i = n; i >= 1; i--) {
    a[i] = a[i + 1];
    if (ch[i] == '.') a[i]++;
  }
  for (int i = 0; i <= n; i++) {
    ans = min(ans, b[i] + a[i + 1]);
  }
  cout << ans;
  return 0;
}
