#!/usr/bin/env python
# coding: utf-8

# In[6]:


N = int(input())
S = input()


# In[8]:


ans = N
for i in range(N+1):
    left = S[:i].count("#")
    right = S[i:].count(".")
    ans = min(ans, left+right)
print(ans)


# In[ ]:




