Regular Expressions

Lab Python Advanced 30 points

Read a line of text. Using re, print all email addresses found (one per line, in order), then the count of numbers (sequences of digits).

Input

One line.

Output

The emails, then the count.

Example

Input

Contact ann@site.com or bob.smith@mail.co.in before 2026-10-16

Output

ann@site.com
bob.smith@mail.co.in
3
Sample input available Sample output available
Editor
Python

Hints

re.findall(pattern, text) returns every match.

\d+ matches one or more digits; \w matches letters, digits and _.

Solution explanation

Use raw strings (r"...") for regex patterns so backslashes reach re unchanged.

Show solution
import re

text = input()
for email in re.findall(r"[\w.+-]+@[\w-]+\.[\w.]+", text):
    print(email)
print(len(re.findall(r"\d+", text)))
Output
Answer
HOME LEARN COMMUNITY DASHBOARD