#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  while (scanf("%d", &a) != EOF) {
    string temp;
    cin >> temp;
    int count = 0;
    for (int i = 0; i < a - 1; i++) {
      if (temp[i] == '#' && temp[i + 1] == '.') {
        int count1 = 0, count2 = 0;
        for (int j = i; j >= 0; j--) {
          if (temp[j] != '#') break;
          count1++;
        }
        for (int j = i + 1; j < a; j++) {
          if (temp[j] != '.') break;
          count2++;
        }
        if (count1 > count2) {
          temp[i + 1] = '#';
          count++;
        } else {
          temp[i] = '.';
          count += count1;
        }
      }
    }
    printf("%d\n", count);
  }
  return 0;
}
