import std.stdio, std.array, std.conv, std.string, std.range, std.algorithm;


void main() {
    long n = readln.strip.to!(long);
    string s = readln.strip;

    long w = s.count('.');
    long b = s.count('#');

    if (w == 0 || b == 0) {
        writeln(0);
        return;
    }

    long left = 0;
    long right = w;

    long m = right;

    foreach (i, c; s) {
        if (i == '.') {
            right--;
        } else {
            left++;
        }
        m = min(m, left + right);
    }
    writeln(m);
}
