n = int(input())
s = input()
w = 0
b = 0
flag = 0
i = 0
for x in s:
    if i > 0:
        if s[i - 1] == "#" and x == "." and flag==0:
            w += 1
            b += 1
            flag = 1
        elif flag == 1 and x == ".":
            w += 1
        elif flag == 1 and x == "#":
            b += 1
    i += 1
print(min(w, b))