#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18, MOD = 1e9 + 7;
int main() {
  string s;
  long long n, start = 0, ans = INF;
  cin >> n >> s;
  long long l = 0;
  for (int i = 0; i < n; i++) {
    long long hoge = 0;
    for (int j = 0; j <= i; j++)
      if (s[j] != '.') hoge++;
    for (int j = i + 1; j < n; j++)
      if (s[j] != '#') hoge++;
    ans = min(ans, hoge);
  }
  cout << ans << endl;
}
