#include <bits/stdc++.h>
using namespace std;
long long cnt[2][214514];
int main() {
  long long n;
  string s;
  cin >> n >> s;
  if (s[0] == '#')
    cnt[0][0]++;
  else
    cnt[1][0]++;
  for (int i = 1; i < n; i++) {
    cnt[0][i] = cnt[0][i - 1];
    cnt[1][i] = cnt[1][i - 1];
    if (s[i] == '#')
      cnt[0][i]++;
    else
      cnt[1][i]++;
  }
  long long ans = 1e9;
  for (int i = 0; i < n; i++) {
    ans = min(ans, cnt[0][i] + cnt[1][n - 1] - cnt[1][i]);
  }
  cout << ans;
  return 0;
}
