inp_num=int(input())
inp=input()
w1=0
b1=0

bf=0
wf=0

for i in range(len(inp)):
    if inp[i]=='#' and wf==0:
        wf=1
        b1=b1+1
    elif inp[i]=='#' and wf==1:
        b1=b1+1
    elif inp[i]=='.' and wf==1:
        w1=w1+1

w2=0
b2=0

for i in range(len(inp)):
    if inp[len(inp)-i-1]=='.' and bf==0:
        bf=1
        w2=w2+1
    elif inp[len(inp)-i-1]=='#' and bf==1:
        b2=b2+1
    elif inp[len(inp)-i-1]=='.' and bf==1:
        w2=w2+1

line=[b1,w1,b2,w2]
#print(line)
print(min(line))