#include <bits/stdc++.h>
using namespace std;
using in = int64_t;
const double PI = 3.14159265358979323846;
const in MOD = 1000000007;
const in INF = 1e18 + 7;
const int inf = 1e9 + 7;
using P = pair<int, int>;
vector<int> dx = {0, 1, -1, 0};
vector<int> dy = {1, 0, 0, -1};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int n;
  string s;
  cin >> n >> s;
  int cntl = 0, cntr = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '#') cntr++;
  }
  int ans = cntr;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '.')
      cntr--;
    else
      cntl++;
    ans = min(ans, cntl + cntr);
  }
  cout << ans << endl;
}
