n = int(input())
s = input()
sr = s[::-1]
left_b = 0
right_w = 0

loop = n//2
for i in  range(loop):
    if s[i] == "#":
        left_b += 1
    if sr[i] == ".":
        right_w += 1
if left_b == 0 or right_w == 0:
    if len(s)%2 == 0:
        print(0)
    elif s[n//2] == s[n//-1] or s[n//2] == s[n//2+1] :
        print(0)
    else:
        print(left_b + right_w)
else:
    print(left_b + right_w)
