Problem:
Score : 100 points

Problem Statement

Takahashi likes the sound when he buys a drink from a vending machine.

That sound can be heard by spending A yen (the currency of Japan) each time.

Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.

How many times will he hear the sound?

Constraints

All values in input are integers.

1 \leq A, B, C \leq 100

Input

Input is given from Standard Input in the following format:

A B C

Output

Print the number of times Takahashi will hear his favorite sound.

Sample Input 1

2 11 4

Sample Output 1

4

Since he has not less than 8 yen, he will hear the sound four times and be satisfied.

Sample Input 2

3 9 5

Sample Output 2

3

He may not be able to be satisfied.

Sample Input 3

100 1 10

Sample Output 3

0

Solution in JavaScript (node.js v5.12) (judge verdict: Wrong Answer)

function Main(input){
  input = input.split("\n");
  inputStr = input[0].split(" ");
  var S = inputStr[0];
  var i = 0;
  var counter = 0;
  var tmp = "";

  while(S.length >= 2 && i+1 < S.length ){  
    //console.log('i=$1',i);
    if (S.substr(i,1) != S.substr(i+1,1) ){
      //console.log(S.substr(i,1));
      //console.log(S.substr(i+1,1));
      
	  //console.log("捨てる");
      //iとi+1番目の配列要素を捨てる
	  tmp = S.substr(1,i) + S.substr(i+2)
      S = tmp;
      //console.log(tmp);
      counter += 2;
      i -= 1;	//一つ前の要素から
    } else {
      //次の要素に進める
      i += 1;
    }
  }
  console.log(counter);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));