#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 9;
int main() {
  int n;
  string second;
  cin >> n;
  cin >> second;
  int pre[n + 1], suf[n + 1];
  memset(pre, 0, sizeof(pre));
  memset(suf, 0, sizeof(suf));
  if (second[0] == '#') pre[0] = 1;
  if (second[n - 1] == '.') suf[n - 1] = 1;
  for (int i = 1; i < n; i++) {
    pre[i] = pre[i - 1];
    if (second[i] == '#') pre[i] += 1;
  }
  for (int i = n - 2; i >= 0; i--) {
    suf[i] = suf[i + 1];
    if (second[i] == '.') suf[i] += 1;
  }
  int mn = INT_MAX;
  for (int i = 0; i < n; i++) {
    mn = min(mn, pre[i] + suf[i + 1]);
  }
  cout << mn;
}
