#include <bits/stdc++.h>
using namespace std;
int main() {
  string stn;
  int N, ans = 0;
  cin >> N >> stn;
  for (int i = 0; i < N; i++) {
    if (stn[i] == '.') ans++;
  }
  int akari;
  for (int i = 0; i < N; i++) {
    if (i == 0) akari = ans;
    if (stn[i] == '#')
      akari++;
    else
      akari--;
    ans == min(akari, ans);
  }
  cout << ans << endl;
}
