import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto N = readln.chomp.to!int;
    auto S = readln.chomp;

    auto A = new int[](N+1);
    foreach (i; 0..N) A[i+1] = A[i] + (S[i] == '#');
    int ans = 1 << 29;

    foreach (i; 0..N+1) {
        int left_black = A[i];
        int right_white = N - i - (A[N] - A[i]);
        ans = min(ans, left_black + right_white);
    }

    ans.writeln;
}