#C13596. Sarah's Apples Problem
Sarah's Apples Problem
Sarah's Apples Problem
Sara and John share a collection of apples. Sarah has twice as many apples as John. Given the total number of apples T, you are required to determine the number of apples Sarah has. The relation between John's apples (J) and Sarah's apples (S) can be expressed as:
\( J + 2J = 3J = T \)
Thus, by computing \( J = \lfloor T/3 \rfloor \), the number of apples Sarah has is \( S = 2J \). Note that integer division is used; any remainder is discarded.
inputFormat
The input consists of a single line containing one integer T (0 ≤ T ≤ 109), representing the total number of apples that Sarah and John have.
outputFormat
Output a single integer representing the number of apples that Sarah has, calculated as \( S = 2\lfloor T/3 \rfloor \).
## sample36
24
</p>