This page is still under construction.

Parts of this page are still being built. What you see may change.

Cupcake Party

Interview

Time limit1sMemory limit1024 MB

Summary
Given R boxes of 8 cupcakes and S boxes of 3 cupcakes, find the number left after 28 students each take one.
Level

Easy1 of 10

Topics
Math, Implementation, Brute force
Solved
No attempts yet

Problem

A regular box holds 8 cupcakes, and a small box holds 3 cupcakes. A class has 28 students, and there are at least 28 cupcakes in total. Determine how many cupcakes are left over after each student gets one cupcake.

Input

The input consists of two lines.

  • The first line contains an integer R≥0R \ge 0, the number of regular boxes.
  • The second line contains an integer S≥0S \ge 0, the number of small boxes.

Output

Output the number of cupcakes that are left over.

Examples2

  1. Example 1

    Input
    2
    5
    
    Expected output
    3
    
  2. Example 2

    Input
    2
    4
    
    Expected output
    0