a = int(input())
ar = list(input())
if ar.count("#") == 0 or ar.count(".") == 0:
    print(0)
else:
    i = -1
    while True:
        if ar[i] == ".":
            break
        else:
            i -= 1
    if i == -1:
        br = ar
    else:
        br = ar[0:i+1]
    print(min(br.count("#"),br.count(".")))