#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll amari = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int sum = 0;
  int num = 0;
  int turn = 0;
  string a = "";
  int end = n;
  int ok = 0;
  while (true) {
    if (s[num] == '#' && s[num + 1] == '.' && ok == 0) {
      turn++;
      num += 2;
    } else {
      a += s[num];
      num++;
    }
    if (a[num] == '#' && a[num + 1] == '.' && ok != 0) {
      turn++;
      num += 2;
    } else {
      a += a[num];
      num++;
    }
    if (num >= end) {
      if (turn == 0)
        break;
      else if (!ok) {
        sum += turn;
        num = 0;
        end = a.size();
        ok++;
        turn = 0;
      } else {
        sum += turn;
        num = end + 1;
        end = a.size();
        turn = 0;
      }
    }
  }
  cout << sum << endl;
  return 0;
}
