human
Can you provide a Python program to print single integer: how many spectators are standing at time t given the following:
Arpa is researching the Mexican wave.

There are n spectators in the stadium, labeled from 1 to n. They start the Mexican wave at time 0. 

  * At time 1, the first spectator stands. 
  * At time 2, the second spectator stands. 
  * ...
  * At time k, the k-th spectator stands. 
  * At time k + 1, the (k + 1)-th spectator stands and the first spectator sits. 
  * At time k + 2, the (k + 2)-th spectator stands and the second spectator sits. 
  * ...
  * At time n, the n-th spectator stands and the (n - k)-th spectator sits. 
  * At time n + 1, the (n + 1 - k)-th spectator sits. 
  * ...
  * At time n + k, the n-th spectator sits. 


Arpa wants to know how many spectators are standing at time t.

Input

The first line contains three integers n, k, t (1 ≤ n ≤ 109, 1 ≤ k ≤ n, 1 ≤ t < n + k).

Output

Print single integer: how many spectators are standing at time t.

Examples

Input

10 5 3

Output

3

Input

10 5 7

Output

5

Input

10 5 12

Output

3

Note

In the following a sitting spectator is represented as -, a standing spectator is represented as ^.

  * At t = 0  ----------  number of standing spectators = 0. 
  * At t = 1  ^---------  number of standing spectators = 1. 
  * At t = 2  ^^--------  number of standing spectators = 2. 
  * At t = 3  ^^^-------  number of standing spectators = 3. 
  * At t = 4  ^^^^------  number of standing spectators = 4. 
  * At t = 5  ^^^^^-----  number of standing spectators = 5. 
  * At t = 6  -^^^^^----  number of standing spectators = 5. 
  * At t = 7  --^^^^^---  number of standing spectators = 5. 
  * At t = 8  ---^^^^^--  number of standing spectators = 5. 
  * At t = 9  ----^^^^^-  number of standing spectators = 5. 
  * At t = 10 -----^^^^^  number of standing spectators = 5. 
  * At t = 11 ------^^^^  number of standing spectators = 4. 
  * At t = 12 -------^^^  number of standing spectators = 3. 
  * At t = 13 --------^^  number of standing spectators = 2. 
 ...
Solve the task in PYTHON3.
assistant
#Here is Python program to print single integer: how many spectators are standing at time t.

# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------- fast io --------------------
from math import gcd, ceil

def prod(a, mod=10**9+7):
    ans = 1
    for each in a:
        ans = (ans * each) % mod
    return ans

def lcm(a, b): return a * b // gcd(a, b)

def binary(x, length=16):
    y = bin(x)[2:]
    return y if...