






import numpy

# List of input, output pairs
A        =			(
    ((5, 2, 3), 15),
    ((6, 5, 9), 25),
    ((11, 12, 13), 41),
    ((1, 1, 1), 8),
    ((11, 12, 13), 41),
)
A        =			(((515, 22, 13), 555), ((61, 35, 49), 150))
A        =			[2, 4, 1, 5]
A        =			len(train_data)
A        =			0.009



def 					_lowerCamelCase(			lowerCAmelCase__				:		Any    ,    lowerCAmelCase__				:		Any="train"      ):





				'''simple docstring'''







				return calculate_hypothesis_value(_lowerCamelCase    ,    _lowerCamelCase      ) - output(
				    _lowerCamelCase    ,    _lowerCamelCase      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		Optional[Any]      ):





				'''simple docstring'''







				SCREAMING_SNAKE_CASE_   :	Dict													=   0
				for i in range(len(_lowerCamelCase      ) - 1      ):
								hyp_val += data_input_tuple[i] * parameter_vector[i + 1]
				hyp_val += parameter_vector[0]
				return hyp_val



def 					_lowerCamelCase(			lowerCAmelCase__				:		Any    ,    lowerCAmelCase__				:		List[Any]      ):





				'''simple docstring'''







				if data_set == "train":
								return train_data[example_no][1]
				elif data_set == "test":
								return test_data[example_no][1]
				return None



def 					_lowerCamelCase(			lowerCAmelCase__				:		Dict    ,    lowerCAmelCase__				:		Tuple      ):





				'''simple docstring'''







				if data_set == "train":
								return _hypothesis_value(train_data[example_no][0]      )
				elif data_set == "test":
								return _hypothesis_value(test_data[example_no][0]      )
				return None



def 					_lowerCamelCase(			lowerCAmelCase__				:		Dict    ,    lowerCAmelCase__				:		Optional[Any]=m      ):





				'''simple docstring'''







				SCREAMING_SNAKE_CASE_   :	int													=   0
				for i in range(_lowerCamelCase      ):
								if index == -1:
												summation_value += _error(_lowerCamelCase      )
								else:
												summation_value += _error(_lowerCamelCase      ) * train_data[i][0][index]
				return summation_value



def 					_lowerCamelCase(			lowerCAmelCase__				:		Any      ):





				'''simple docstring'''







				SCREAMING_SNAKE_CASE_   :	Tuple													=   summation_of_cost_derivative(_lowerCamelCase    ,    _lowerCamelCase      ) / m
				return cost_derivative_value



def 					_lowerCamelCase(			):





				'''simple docstring'''







				global parameter_vector
				# Tune these values to set a tolerance value for predicted output
				SCREAMING_SNAKE_CASE_   :	List[str]													=   0.000_002
				SCREAMING_SNAKE_CASE_   :	List[str]													=   0
				SCREAMING_SNAKE_CASE_   :	Any													=   0
				while True:
								j += 1
								SCREAMING_SNAKE_CASE_   :	int													=   [0, 0, 0, 0]
								for i in range(0    ,    len(_lowerCamelCase      )      ):
												SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   get_cost_derivative(i - 1      )
												SCREAMING_SNAKE_CASE_   :	Any													=   (
												    parameter_vector[i] - LEARNING_RATE * cost_derivative
												)
								if numpy.allclose(
								    _lowerCamelCase    ,    _lowerCamelCase    ,    atol=_lowerCamelCase    ,    rtol=_lowerCamelCase    ,    ):
												break
								SCREAMING_SNAKE_CASE_   :	Any													=   temp_parameter_vector
				print(('Number of iterations:', j)      )



def 					_lowerCamelCase(			):





				'''simple docstring'''







				for i in range(len(_lowerCamelCase      )      ):
								print(('Actual output value:', output(_lowerCamelCase    ,    'test'      ))      )
								print(('Hypothesis output:', calculate_hypothesis_value(_lowerCamelCase    ,    'test'      ))      )


if __name__ == "__main__":
				run_gradient_descent()
				print('\nTesting gradient descent for a linear hypothesis function.\n')
				test_gradient_descent()







def 					_lowerCamelCase(			):





				'''simple docstring'''







				return 1



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else two_pence(x - 2      ) + one_pence()



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else five_pence(x - 5      ) + two_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else ten_pence(x - 10      ) + five_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else twenty_pence(x - 20      ) + ten_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else fifty_pence(x - 50      ) + twenty_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else one_pound(x - 100      ) + fifty_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else two_pound(x - 200      ) + one_pound(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int = 200      ):





				'''simple docstring'''







				return two_pound(lowerCAmelCase__      )


if __name__ == "__main__":
				print(solution(int(input().strip())))