eolymp
bolt
Try our new interface for solving problems
Problems

IP-address

IP-address

In order to access the Internet, each computer is assigned a so-called IP-address. It consists of four integers in the range from 0 to 255 separated by dots. The next three lines show three valid IP-address:

127.0.0.0

192.168.0.01

255.00.255.255

Write a program that determines whether a given string is a valid IP-address.

Input

The input to the program served a string no longer than 15 characters, which includes figures and exactly three points.

Output

If the string is a valid IP-address, you must withdraw 1, 0 otherwise.

Time limit 1 second
Memory limit 64 MiB
Input example #1
127.0.0.1
Output example #1
1
Source Stage II Ukrainian School Olympiad 2011-2012, Berdichev