#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int cntW = 0;
  int cntB = 0;
  int ans = 1000000;
  string str;
  cin >> n;
  cin >> str;
  for (int i = 0; i < n; i++)
    if (str[i] == '.') cntW++;
  for (int i = 0; i < n; i++) {
    if (str[i] == '.') cntW--;
    if (str[i] == '#') cntB++;
    if (str[i] == '#' || i == n - 1) ans = min(ans, cntW + cntB);
  }
  cout << ans << endl;
}
