#include <bits/stdc++.h>
using namespace std;
int tong = 0;
int viTri(string s) {
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '#' && s[i + 1] == '.') return i;
  }
  return -1;
}
bool Test(string s, int viTri) {
  int den = 0;
  int trang = 0;
  for (int i = viTri + 1; s.length(); i++) {
    if (s[viTri + 1] == s[i])
      den++;
    else
      break;
  }
  for (int i = viTri; i >= 0; i--) {
    if (s[viTri] == s[i])
      trang++;
    else
      break;
  }
  if (den >= trang) return true;
  return false;
}
void doiMau(string s) {
  while (viTri(s) != -1) {
    int vitri = viTri(s);
    if (Test(s, vitri)) {
      for (int i = vitri; i >= 0; i--) {
        if (s[i] == '#') {
          s[i] = '.';
          tong++;
        } else
          break;
      }
    } else {
      for (int i = vitri + 1; i < s.length(); i++) {
        if (s[i] == '.') {
          tong++;
          s[i] = '#';
        } else
          break;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  doiMau(s);
  cout << endl;
  cout << tong;
  return 0;
}
