Under construction

Still being built. Things may change

Multiplication Table

Time limit0.5sMemory limit1024 MB

Summary
Given N from 1 to 100, the task is to print 1 if N appears as a factor or product in the 2 to 9 multiplication tables, otherwise 0.
Level

Easy1 of 10

Topics
Brute force, Implementation
Solved
No attempts yet

Problem

The multiplication table is made of entries in the form A×B=CA\times B = C. The table for 2 is shown below, and the tables run from the 2 times table to the 9 times table.

2 times table
2×1=22\times 1 = 2
2×2=42\times 2 = 4
2×3=62\times 3 = 6
2×4=82\times 4 = 8
2×5=102\times 5 = 10
2×6=122\times 6 = 12
2×7=142\times 7 = 14
2×8=162\times 8 = 16
2×9=182\times 9 = 18

Given a positive integer NN, determine whether the number appears in the multiplication table. NN counts as appearing if it equals any one of AA, BB, or CC.

Input

The first line contains a positive integer NN. (1≤N≤100)\left(1\leq N\leq 100\right)

Output

If the given number appears in the multiplication table, print 1. Otherwise, print 0.

Examples2

  1. Example 1

    Input
    5
    
    Expected output
    1
    
  2. Example 2

    Input
    13
    
    Expected output
    0