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

# In[1]:


ds = [int(input()) for i in range(5)]
"""
29
20
7
35
120
"""


# In[6]:


s1 = [d%10 for d in ds if d%10!=0]
if s1:
    m1 = min(s1)
else:
    m1 = 0


# In[ ]:


sum_ = 0
for d in ds:
    sum_


# In[7]:


bool([])


# In[ ]:




