#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[]) {
  int n;
  string s;
  int cnt = 0;
  cin >> n;
  cin >> s;

  for (size_t i = 0; i < n; i++) {
    if (s[i] == '.') cnt++;
  }
  int ans = cnt;

  for (size_t i = 0; i < n; i++) {
    if (s[i] == '.')
      cnt--;
    else if (s[i] == '#')
      cnt++;
    ans = min(ans, cnt);
  }

  cout << ans << endl;
  return 0;
}