#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using ll = long long;
constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);
using namespace std;
void scans(string& str) {
  char c;
  str = "";
  scanf("%c", &c);
  if (c == '\n') scanf("%c", &c);
  while (c != '\n' && c != -1) {
    str += c;
    scanf("%c", &c);
  }
}
void scanc(char& str) {
  char c;
  scanf("%c", &c);
  if (c == -1) return;
  while (c == '\n') {
    scanf("%c", &c);
  }
  str = c;
}
double acot(double x) { return PI / 2 - atan(x); }
int main() {
  int n;
  string s;
  scanf("%d", &n);
  scans(s);
  int white = 0, flag = -1;
  for (int i = 0; i < (n); ++i) {
    if (i < n - 1 && flag < 0)
      if (s[i] == '#' && s[i + 1] == '.') flag = i;
    if (flag > -1) white += (s[i] == '.');
  }
  printf("%d\n", min(white, (n - flag) - white));
  return 0;
}
