#include <bits/stdc++.h>
using namespace std;
int mx8[] = {0, 0, 1, -1, -1, 1, -1, 1};
int my8[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int mx4[] = {1, -1, 0, 0};
int my4[] = {0, 0, -1, 1};
const int MOD = 1000000007;
long long int y[10000005];
int main() {
  int n;
  string s;
  cin >> n >> s;
  int w = 0, b = 0, ans = 2 * n;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') w++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      b++;
    else
      w--;
    ans = min(ans, b + w);
  }
  cout << ans << endl;
}
