#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const long long int MAX = -1000000000000000000;
const long long int MIN = 1000000000000000000;
const long long int inf = 1000000000;
const long long int KOK = 100000;
const long long int LOG = 30;
const long long int li = 3000005;
const long long int mod = 1000000007;
long long int n, m, cev, b, a[li], k, PS[li], PS1[li];
string s;
vector<long long int> v;
inline long long int solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> s;
  for (long long int i = 0; i < (long long int)s.size(); i++) {
    if (i != 0) PS[i] = PS[i - 1];
    if (i != 0) PS1[i] = PS1[i - 1];
    if (s[i] == '.') PS[i]++;
    if (s[i] == '#') PS1[i]++;
  }
  long long int mx = inf;
  for (long long int i = 0; i < n; i++) {
    cev = 0;
    cev += PS[n - 1] - PS[i];
    cev += PS1[i];
    mx = min(mx, cev);
  }
  cout << mx << endl;
  return 0;
}
int main(void) {
  solve();
  return 0;
}
