#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  vector<int> vec;
  bool start = 0;
  bool swi;
  if (s.substr(0, 1) == "#") {
    swi = 0;
  } else {
    swi = 1;
    start = 1;
  }
  if (swi == 0) {
    vec.push_back(0);
  }
  int f = 0;
  int cont = 1;
  for (int i = 0; i < s.length() - 1; i++) {
    if (swi == 0) {
      if (s.substr(i, 1) == "#" && s.substr(i + 1, 1) == ".") {
        vec.push_back(cont);
        swi = 1;
        cont = 1;
      } else {
        cont++;
      }
    } else {
      if (s.substr(i, 1) == "." && s.substr(i + 1, 1) == "#") {
        vec.push_back(cont);
        swi = 0;
        cont = 1;
      } else {
        cont++;
      }
    }
  }
  vec.push_back(cont);
  if (vec.size() == 1) {
    cout << vec[0] << endl;
    return 0;
  }
  if (vec.size() == 2) {
    if (start == 1) {
      cout << "0" << endl;
    } else {
      cout << vec[1] << endl;
    }
    return 0;
  }
  long long ans = 0;
  long long ans2 = 0;
  if (start == 1) {
    vec[0] = 0;
  }
  for (int i = 0; i < vec.size(); i = i + 2) {
    ans += vec[i];
  }
  for (int i = 1; i < vec.size(); i = i + 2) {
    ans2 += vec[i];
  }
  if (ans < ans2) {
    cout << ans << endl;
  } else {
    cout << ans2 << endl;
  }
}
