#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, ans = 0;
  string str;
  cin >> n;
  cin >> str;
  for (int i = 0; i < n - 1; i++) {
    if (str[i] == '#' && str[i + 1] == '.') {
      int w = 1, b = 1;
      for (int j = i - 1; j >= 0; j--) {
        if (str[j] == '#')
          b++;
        else
          break;
      }
      for (int j = i + 2; j < n; j++) {
        if (str[j] == '.')
          w++;
        else
          break;
      }
      if (w > b) {
        ans += b;
        for (int j = i; j >= 0; j--) {
          if (str[j] == '#') {
            str[j] = '.';
          } else
            break;
        }
        i += b - 1;
      } else {
        ans += w;
        for (int j = i + 1; j < n; j++) {
          if (str[j] == '.') {
            str[j] = '#';
          } else
            break;
        }
        i += b - 1;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
