import std;

void main() {
  int n;
  string s;
  scan(n);
  scan(s);
  auto w = new int[](n + 1);
  auto b = new int[](n + 1);
  foreach (i; 1 .. n + 1) {
    b[i] = b[i-1] + (s[i-1]=='#');
  }
  foreach_reverse (i; 0 .. n) {
    w[i] = w[i+1] + (s[i]=='.');
  }
  auto ans = 1_000_000_000;
  foreach (i; 0 .. n + 1) {
    chmin(ans, b[i] + w[i]);
  }
  writeln(ans);
}

long[] factor(int x) {
  long[] res;
  for (int i = 2; i*i <= x; i++) {
    while (x % i == 0) {
      x /= i;
      res ~= i;
    }
    
  }
  if (x > 1) res ~= x;
  return res;
}

void scan(T...)(ref T args) {
    auto line = readln.split; // @suppress(dscanner.suspicious.unmodified)
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront;
    }
    assert(line.empty);
}
 
void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
 
bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;
    foreach (arg; args)
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    return isChanged;
}
 
bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;
    foreach (arg; args)
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    return isChanged;
}
 
void yes(bool ok, string y = "Yes", string n = "No") {
    return writeln(ok ? y : n);
}