

# To run this, download the BeautifulSoup zip file
# http://www.py4e.com/code3/bs4.zip
# and unzip it in the same directory as this file

from urllib.request import urlopen
from bs4 import BeautifulSoup
import ssl

# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

url = input('Enter - ')
html = urlopen(url, context=ctx).read()
soup = BeautifulSoup(html, "html.parser")

# Retrieve all of the anchor tags
spans = soup('span')
count=0
for span in spans:
    # Look at the parts of a tag
    #print('TAG:', span)
    #print('URL:', span.get('href', None))
    #print('Contents:', span.contents[0]
    #print('Attrs:', span.attrs)
    count+=int(span.contents[0])
print(count)