#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  string T = S;
  int an, ans;
  an = 0;
  ans = 0;
  string a;
  string b;
  string c = S.substr(0, 1);
  vector<int> cou(2, 0);
  vector<int> coun(2, 0);
  if (c == "#") {
    cou[0] += 1;
    for (int i = 1; i < N; i++) {
      a = S.substr(i, 1);
      if (a == "#") {
        cou[0] += 1;
      } else {
        cou[1] += 1;
        for (int j = i + 1; j < N; j++) {
          a = S.substr(j, 1);
          if (a == ".") {
            cou[1] += 1;
          }
        }
      }
    }
    coun[0] = cou[0];
    coun[1] = cou[1];
  } else {
    cou[1] += 1;
    for (int i = 1; i < N; i++) {
      a = S.substr(i, 1);
      if (a == ".") {
        cou[1] += 1;
      } else {
        cou[0] += 1;
        for (int j = i + 1; j < N; j++) {
          a = S.substr(j, 1);
          if (a == "#") {
            cou[0] += 1;
          }
        }
      }
    }
    coun[0] = cou[0];
    coun[1] = cou[1];
  }
  if (coun[1] < coun[0]) {
    cout << coun[1] << endl;
  } else {
    cout << coun[0] << endl;
  }
}
