n = int(input())
s_input = input() 

def judge(s,count):
    if s.count("#.")==0:
        return count

    next=""
    for i in range(0,n-1):
        if s[i]=="#" and s[i+1]==".":
            next1 = s[:i] + "##"
            if i<n-2:
                next1+=s[i+2:]
            pat1 = judge(next1,count+1)

            pat2=pat1
            if i > 0 and s[i-1]==".":
                next2 = s[:i] + ".."
                if i < n-2:
                    next2+=s[i+2:]
                pat2 = judge(next2,count+1)
            return min(pat1,pat2)
    return count

print(judge(s_input,0))