Under construction

Still being built. Things may change

Lucky 7

Time limit5sMemory limit1024 MB

Summary
Given an integer, the task is to print 0, 1, 2, or 3 depending on whether the number contains digit 7 and whether it is divisible by 7.
Level

Easy1 of 10

Topics
Math, String, Implementation
Solved
No attempts yet

Problem

Fact or Fiction, some people consider 7 to be a lucky digit or number.

Given a number, determine how lucky it is by printing one of four values:

  • Print 0 if the number does not contain 7 and is not divisible by 7.
  • Print 1 if the number does not contain 7 but is divisible by 7.
  • Print 2 if the number contains 7 but is not divisible by 7.
  • Print 3 if the number contains 7 and is divisible by 7.

Input

There is only one input line, containing one integer between 1 and 10910^9, inclusive.

Output

Print one of the four messages as described above.

Examples5

  1. Example 1

    Input
    25
    
    Expected output
    0
    
  2. Example 2

    Input
    42
    
    Expected output
    1
    
  3. Example 3

    Input
    170
    
    Expected output
    2
    
  4. Example 4

    Input
    777
    
    Expected output
    3
    
  5. Example 5

    Input
    1
    
    Expected output
    0