import std.stdio;
import std.string;
import std.conv;
import std.array;

void main()
{
    ulong N = readln.split[0].to!ulong;
    char[] S = readln.chomp.to!(char[]);

    ulong last_i = N;
    while (last_i > 0 && S[last_i - 1] == '#') last_i--;

    int cnt = 0;
    foreach (i; 0..last_i) if (S[i] == '.') cnt++;

    ulong ans0 = cnt;
    if (S[0] == '.') ans0--;

    ulong ans1 = last_i - cnt;

    writeln(ans0 < ans1 ? ans0 : ans1);
}

