#include <bits/stdc++.h>
using namespace std;
int n, ans = 1e8, x1, x2, sum1, sum2;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++)
    if (s[i] == '#') {
      x1 = i;
      break;
    }
  for (int i = n - 1; i >= 0; i--)
    if (s[i] == '.') {
      x2 = i;
      break;
    }
  for (int i = 0; i < x2; i++)
    if (s[i] == '#') sum2++;
  for (int i = 0; i < n; i++) {
    bool y = false;
    if (i > x1 and s[i] == '.') sum1++, y = true;
    if (i < x2 and s[i] == '#') sum2--, y = true;
    ans = min(ans, sum1 + sum2 + y);
  }
  cout << ans;
  return 0;
}
