package main

import (
	"fmt"
	"math"
)

func main() {
	var r float64
	var i int
	fmt.Scan(&i)
	var x int
	fmt.Scan(&x)
	for  q:=0;q<i ;q++  {
		var z int
		fmt.Scan(&z)

		r += math.Ceil(float64(z)/float64(x))
	}

	fmt.Println(r)

}


package main

import "fmt"

func main() {
	var noPersons int
	var fenceHeight int
	var heightOfPerson int
	fmt.Scan(&noPersons, &fenceHeight)
	var minRoadWidth int = noPersons
	for index := 0; index < noPersons; index++ {
		fmt.Scan(&heightOfPerson)
		if heightOfPerson > fenceHeight {
			minRoadWidth = minRoadWidth + 1
		}
	}
	fmt.Print(minRoadWidth)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	reader *bufio.Reader = bufio.NewReader(os.Stdin)
	writer *bufio.Writer = bufio.NewWriter(os.Stdout)
)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
    defer writer.Flush()

    var n, mh int64
    scanf("%d %d\n", &n, &mh)
    heights := []int64{}
    for ; n > 0; n-- {
        var h int64
        scanf("%d", &h)
        heights = append(heights, h)
    }
    res := 0
    for _, h := range heights {
        if h <= mh {
            res += 1
        } else {
            res += 2
        }
    }
    printf("%d", res)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	reader *bufio.Reader = bufio.NewReader(os.Stdin)
	writer *bufio.Writer = bufio.NewWriter(os.Stdout)
)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
    defer writer.Flush()

    var n, mh, h int64
    scanf("%d %d\n", &n, &mh)
    res := 0
    for ; n > 0; n-- {
        scanf("%d", &h)
        if h <= mh {
            res += 1
        } else {
            res += 2
        }
    }
    printf("%d", res)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	heights, maxHeight := in3()
	res := sol(heights, maxHeight)
	out1(res)
}

// 31ms
func in1() ([]int64, int64) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	l1 := scanner.Text()
	scanner.Scan()
	l2 := scanner.Text()
	maxHeight, _ := strconv.Atoi(strings.Split(l1, " ")[1])
	heights := []int64{}
	for _, h := range strings.Split(l2, " ") {
		hint, _ := strconv.Atoi(h)
		heights = append(heights, int64(hint))
	}
	return heights, int64(maxHeight)
}

// 46ms
func in2() ([]int64, int64) {
	var n, maxHeight int64
	fmt.Scanf("%d %d\n", &n, &maxHeight)
	heights := []int64{}
	for ; n > 0; n-- {
		var h int64
		fmt.Scanf("%d", &h)
		heights = append(heights, h)
	}
	return heights, maxHeight
}

func scanf(reader *bufio.Reader, f string, a ...interface{}) {
	fmt.Fscanf(reader, f, a...)
}

func in3() ([]int64, int64) {
	reader := bufio.NewReader(os.Stdin)
	var n, maxHeight int64
	scanf(reader, "%d %d\n", &n, &maxHeight)
	heights := []int64{}
	for ; n > 0; n-- {
		var h int64
		scanf(reader, "%d", &h)
		heights = append(heights, h)
	}
	return heights, maxHeight
}

func out1(i int64) {
	fmt.Println(i)
}

func sol(heights []int64, max int64) int64 {
	ret := int64(0)
	for _, h := range heights {
		if h <= max {
			ret += 1
		} else {
			ret += 2
		}
	}
	return ret
}


package main

import (
    "bufio"
    "fmt"
    "os"
    "strings"
    "strconv"
)

func main() {
    heights, maxHeight := in2()
    res := sol(heights, maxHeight)
    out1(res)
}

func in1() ([]int64, int64) {
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Scan()
    l1 := scanner.Text()
    scanner.Scan()
    l2 := scanner.Text()
    maxHeight, _ := strconv.Atoi(strings.Split(l1, " ")[1])
    heights := []int64{}
    for _, h := range(strings.Split(l2, " ")) {
        hint, _ := strconv.Atoi(h)
        heights = append(heights, int64(hint))
    }
    return heights, int64(maxHeight)
}

func in2() ([]int64, int64) {
    var n, maxHeight int64
    fmt.Scanf("%d %d\n", &n, &maxHeight)
    heights := []int64{}
    for ; n > 0; n-- {
        var h int64
        fmt.Scanf("%d", &h)
        heights = append(heights, h)
    }
    return heights, maxHeight
}

func out1(i int64) {
    fmt.Println(i)
}

func sol(heights []int64, max int64) int64 {
    ret := int64(0)
    for _, h := range heights {
        if h <= max {
            ret += 1
        } else {
            ret += 2
        }
    }
    return ret
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	reader *bufio.Reader = bufio.NewReader(os.Stdin)
	writer *bufio.Writer = bufio.NewWriter(os.Stdout)
)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
    defer writer.Flush()

    var n, mh int64
    scanf("%d %d\n", &n, &mh)
    heights := make([]int64, n)
    for ; n > 0; n-- {
        var h int64
        scanf("%d", &h)
        heights[n-1] = h
    }
    res := 0
    for _, h := range heights {
        if h <= mh {
            res += 1
        } else {
            res += 2
        }
    }
    printf("%d", res)
}


package main

import (
    "bufio"
    "fmt"
    "os"
    "strings"
    "strconv"
)

func main() {
    heights, maxHeight := in1()
    res := sol(heights, maxHeight)
    out1(res)
}

func in1() ([]int64, int64) {
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Scan()
    l1 := scanner.Text()
    scanner.Scan()
    l2 := scanner.Text()
    maxHeight, _ := strconv.Atoi(strings.Split(l1, " ")[1])
    heights := []int64{}
    for _, h := range(strings.Split(l2, " ")) {
        hint, _ := strconv.Atoi(h)
        heights = append(heights, int64(hint))
    }
    return heights, int64(maxHeight)
}

func out1(i int64) {
    fmt.Println(i)
}

func sol(heights []int64, max int64) int64 {
    ret := int64(0)
    for _, h := range heights {
        if h <= max {
            ret += 1
        } else {
            ret += 2
        }
    }
    return ret
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	reader *bufio.Reader = bufio.NewReader(os.Stdin)
	writer *bufio.Writer = bufio.NewWriter(os.Stdout)
)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
    defer writer.Flush()

    var n, mh int64
    scanf("%d %d\n", &n, &mh)
    res := 0
    for ; n > 0; n-- {
        var h int64
        scanf("%d", &h)
        if h <= mh {
            res += 1
        } else {
            res += 2
        }
    }
    printf("%d", res)
}


<?php
$n=readline();
$n_h=explode(' ',$n);
$num=$n_h[0];
$height=$n_h[1];
$friends=readline();
$arr=explode(' ',$friends);
$r=0;
for($i=0;$i<$num;$i++){
    if($arr[$i]>$height)
    $r+=2;
    else
    $r+=1;
}
echo $r;


<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
$d = 0;
for($x = 0; $x < $a; $x++)
{
     if($c[$x] <= $b)
     {
          $d++;
     }
     else
     {
          $d += 2;
     }
}
print $d;
?>


<?php

list($count, $height) = explode(" ", trim(fgets(STDIN)));
$friends = explode(" ", trim(fgets(STDIN)));

$result = 0;

foreach ($friends as $friend) {
    $result += $friend > $height ? 2 : 1;
}

echo $result;


<?php
$arr = [];

for ($i=0; $i < 2; $i++) {
        $arr[$i] = readline();
}

// Output
//print_r($arr);
$arr[0];
$output = 0;

$pieces = explode(" ", $arr[0]);

$sec = explode(" ", $arr[1]);
  for($i = 0; $i < $pieces[0] ; $i++){
        print_r($sec[$i]  );
     if($sec[$i] > $pieces[1]){
        $output = $output+2;
     }else{
        $output += 1;
     }
 }

 echo   "\n". $output;
?>


<?php
$arr = [];

for ($i=0; $i < 2; $i++) {
        $arr[$i] = readline();
}

// Output
//print_r($arr);
$arr[0];
$output = 0;

$pieces = explode(" ", $arr[0]);

$sec = explode(" ", $arr[1]);
  for($i = 0; $i < $pieces[0] ; $i++){

     if($sec[$i] > $pieces[1]){
        $output = $output+2;
     }else{
        $output += 1;
     }
 }

 echo   "\n". $output;
?>


<?php
$input1 = readline();
$input2 = readline();

$line1 = (explode(" ",$input1));

$line2 = (explode(" ",$input2));

$n = $line1[0];
$h = $line1[1];
$w = 0;

foreach ($line2 as $f) {
    if($f > $h) {
        $w += 2;
    } else {
        $w += 1;
    }
}

echo $w;

?>


<?php
$lines  = @file("php://stdin");
$info = explode(' ', $lines[0]);
$friends = explode(' ', $lines[1]);

$fn = $info[0];
$h = $info[1];

$w = $fn;

foreach($friends as $friend)
    if(intval($friend) > $h) $w++;

echo $w;


<?php
/**
 * Created by PhpStorm.
 * User: OSAMA
 * Date: 6/12/2019
 * Time: 3:38 PM
 */

$input="";
$dir = fopen("php://stdin", 'r');;
while (!feof($dir)) $input .= fgets($dir) ." ";
$input = explode(' ' , trim($input));
 list($n,$h)= array_slice($input,0,2);
$heights = array_slice($input,2);
$width=0;
for ($i=0 ,$c=count($heights); $i<$c ;$i++){
    if ((int)$heights[$i] > (int)$h ){
        $width += 2;
    }else{
        $width+=1;
    }
}
echo $width;


<?php

$dir = fopen("php://stdin", 'r');
 $input= stream_get_contents($dir);
 list($firstLine,$secondLine)= explode('\n',$input);
 list($n,$h)=explode(' ' , trim($firstLine));
$heights = explode(' ', trim($secondLine));
$width=0;
foreach ($heights as $height){
    if ($height > $h ){
        $width = $width + 2;
    }else{
        $width ++;
    }
}
echo $width;


<?php
/**
 * Created by PhpStorm.
 * User: OSAMA
 * Date: 6/12/2019
 * Time: 3:38 PM
 */

$dir = fopen("php://stdin", 'r');
 $input= stream_get_contents($dir);
 list($firstLine,$secondLine)= explode('\n',trim($input));
 list($n,$h)=explode(' ' , trim($firstLine));
$heights = explode(' ', trim($secondLine));
$width=0;
foreach ($heights as $height){
    if ($height > $h ){
        $width = $width + 2;
    }else{
        $width ++;
    }
}
echo $width;


<?php
$dir = fopen("php://stdin", 'r');;
$input= file('php://stdin');
 list($n,$h)= explode(' ',$input[0]);
 $heights=explode(' ' ,$input[1]);
$width=0;
for ($i=0 ,$c=count($heights); $i<$c ;$i++){
    if ((int)$heights[$i] > (int)$h ){
        $width += 2;
    }else{
        $width += 1;
    }
}
echo $width;


<?php
/**
 * Created by PhpStorm.
 * User: OSAMA
 * Date: 6/12/2019
 * Time: 3:38 PM
 */

$dir = fopen("php://stdin", 'r');
$input = explode(' ' , trim(stream_get_contents($dir)));
 list($n,$h)= array_slice($input,0,2);
$heights = array_slice($input,2);
$width=0;
for ($i=0 ,$c=count($heights); $i<$c ;$i++){
    if ((int)$heights[$i] > (int)$h ){
        $width += 2;
    }else{
        $width+=1;
    }
}

echo $width;


<?php

//=====================================
// link: https://codeforces.com/contest/677/problem/A
//=====================================
$width = 0;

$input = new Input(['fence', 'heights']);

$fence = $input->fence[1];

foreach ($input->heights as $key => $height) {
    $width += ($height > $fence) ? 2 : 1;
}

echo $width . "\n";

//=====================================
// Per-defined helpers
//=====================================
class Input
{
    public $inputs = [];

    public function __construct(array $input_titles = ['line'])
    {
        $this->getInputs($input_titles);
    }

    private function getInputs($input_titles)
    {
        for ($i=0; $i < count($input_titles); $i++) {
            $this->inputs[$input_titles[$i]] = explode(' ', trim(fgets(STDIN)));
        }
    }

    public function __get($name)
    {
        return $this->inputs[$name];
    }
}


<?php
    fscanf(STDIN, " %d %d", $n, $h);
    $arr = explode(" ", trim(fgets(STDIN)));
    $k = 0;
        for ($i = 0; $i < $n; $i++){
            if ($arr[$i] > $h){
                $k = $k+2;
            }
            else $k = $k+1;
        }
        echo $k;


<?php
$str_nh = explode(" ", trim(fgets(STDIN)));
$n = $str_nh[0];
$h = $str_nh[1];
$str_ai = explode(" ", trim(fgets(STDIN)));
$w = 0;
for ($i = 0; $i < $n; $i++) {
    if ($str_ai[$i] > $h) {
        $w += 2;
    } else {
        $w += 1;
    }
}
print $w;
?>


<?php
function input()
{
    while (($line = fgets(STDIN)) != PHP_EOL) {
        yield $line;
    }
}

$COUNT = 0;
foreach (input() as $line) {
    if ($COUNT == 0) {
        list($n, $s) = explode(' ', $line);
        ++$COUNT;
        continue;
    }
    $hs = array_map('intval', explode(' ', $line));
    $w = 0;
    for($i = 0; $i < count($hs);++$i) {
        if ($hs[$i] > $s) {
            $w += 2;
        }
        else {
            $w += 1;
        }
    }

    echo $w;

    if (++$COUNT > 1) {
        break;
    }
}


<?php
// http://codeforces.com/problemset/problem/691/A
$handle = fopen ("php://stdin", "r");

$arr_temp1 = fgets($handle);
$arr1 = explode(" ",$arr_temp1);
$arr1 = array_map('intval', $arr1);
$h = $arr1[1];

$arr_temp = fgets($handle);
$arrInput = explode(" ",$arr_temp);
$arr = array_map('intval', $arrInput);
$total = 0;
foreach ($arr as $height) {
	$s = $height > $h ? 2 : 1;
	$total += $s;
}
echo $total;

?>


<?php
fscanf(STDIN,"%d %d",$n,$h);
$line=trim(fgets(STDIN));
$array=explode(' ',$line);
$count=0;
for($i=0;$i<$n;$i++)
{
	if($array[$i]<=$h)
		$count++;
	else
		$count+=2;
}
echo $count;
//print_r($singleValue);


<?php
$n=readline();
$height_friends();
//$n = '3 7';
$quantity = $n[0];
$height_fence = $n[-1];
//$height_friends = '4 5 14';
$height_friends = explode(' ', $height_friends);
$sum = 0;
foreach ($height_friends as $v){
    if ($v < $height_fence ){
        $sum++;
    } else {
        $sum = $sum + 2;
    }
}
echo $sum;


<?php
$n = readline();
$height_friends = readline();
//$n = '10 420';
$n = explode(' ', $n);
$quantity = $n[0];
$height_fence = $n[1];
//$height_friends = '214 614 297 675 82 740 174 23 255 15';
$height_friends = explode(' ', $height_friends);
$sum = 0;
foreach ($height_friends as $v){
    if ($v <= $height_fence ){
        $sum++;
    } else {
        $sum = $sum + 2;
    }
}
echo $sum;


<?php
$n = readline();
$height_friends = readline();
//$n = '3 7';
$quantity = $n[0];
$height_fence = $n[-1];
//$height_friends = '4 5 14';
$height_friends = explode(' ', $height_friends);
$sum = 0;
foreach ($height_friends as $v){
    if ($v < $height_fence ){
        $sum++;
    } else {
        $sum = $sum + 2;
    }
}
echo $sum;


<?php
$n = readline();
$height_friends = readline();
//$n = '3 7';
$quantity = $n[0];
$height_fence = $n[-1];
//$height_friends = '4 5 14';
$height_friends = explode(' ', $height_friends);
$sum = 0;
foreach ($height_friends as $v){
    if ($v <= $height_fence ){
        $sum++;
    } else {
        $sum = $sum + 2;
    }
}
echo $sum;


<>php
$n = readline();
$height_friends = readline();
//$n = '3 7';
$quantity = $n[0];
$height_fence = $n[-1];
//$height_friends = '4 5 14';
$height_friends = explode(' ', $height_friends);
$sum = 0;
foreach ($height_friends as $v){
    if ($v <= $height_fence ){
        $sum++;
    } else {
        $sum = $sum + 2;
    }
}
echo $sum;


<?php

$in = fopen("php://stdin", 'r');

$row = explode(' ', fgets($in)); // [0 => n, 1 => h]
$ans = 0;

array_map(function($item) {
    global $ans, $row;
    $ans += intval($item) > intval($row[1]) ? 2 : 1;
}, explode(' ', fgets($in)));

echo $ans;

?>


<?php

function gaber($n , $h , $arr)
{
     $sum = 0 ;
     for($i=0 ; $i<$n ; $i++)
     {
          if( $arr[$i] <= $h )
          {
               $sum++ ;
          }
          else{
               $sum += 2 ;
          }
     }
     echo $sum ;
}

$stdout = fopen( getenv( "OUTPUT_PATH" ) , "w" ) ;
$stdin = fopen( "php://stdin" , "r" ) ;

fscanf( $stdin , "%d %d" , $n , $h ) ;
fscanf( $stdin , "%[^\n]", $ar_temp);
$arr = array_map('intval', preg_split('/ /', $ar_temp, -1, PREG_SPLIT_NO_EMPTY) );

$result = gaber( $n , $h , $arr )  ;

fwrite ( $stdout , $result . "\n" ) ;

fclose( $stdin ) ;
fclose( $stdout ) ;

?>


<?php

$file = fopen("php://stdin", "r");

$members = array();

while (! feof( $file ) )
{
   $members[] = fgets($file);
}

$n1 = array() ;
$n1 = explode( ' ' , $members[0]  ) ;

$n2 = array() ;
$n2 = explode( ' ' , $members[1]  );

$s = 0 ;

for($i=0 ; $i<count($n2) ; $i++)
{
	if( (int) $n2[$i] <= (int)$n1[1] )
	{
	     $s = $s + 1 ;
	}
	else
	{
	     $s = $s + 2 ;
	}

}

echo $s ;

?>


<?php

$input =  rtrim(fgets(STDIN));
$first_row = explode(' ', $input);
$number_friends = (int)$first_row[0];
$height_fence   = (int)$first_row[1];

$road_width = 0;

$second_input = rtrim(fgets(STDIN));
$friends_height = explode(' ', $second_input);

foreach ($friends_height as $friend_height) {
    $result = ($friend_height<=$height_fence) ? 1 : 2;
    $road_width+=$result;
}

echo($road_width);


<?php

$input =  rtrim(fgets(STDIN));
$first_row = explode(' ', $input);
$number_friends = (int)$first_row[0];
$height_fence   = (int)$first_row[1];

$road_width = 0;

$second_input = rtrim(fgets(STDIN));
$friends_height = explode(' ', $second_input);

foreach ($friends_height as $friend_height) {
    $road_width += ($friend_height<=$height_fence) ? 1 : 2;
}

echo($road_width);


<?php

$input =  rtrim(fgets(STDIN));
$first_row = explode(' ', $input);
$number_friends = (int)$first_row[0];
$height_fence   = (int)$first_row[1];

$road_width = 0;

$second_input = rtrim(fgets(STDIN));
$friends_height = explode(' ', $second_input);

foreach ($friends_height as $friend_height) {
    $road_width += ($friend_height<$height_fence) ? 1 : 2;
}

echo($road_width);


<?php
  list($n, $h) = explode(' ', trim(fgets(STDIN)));
  $ans = 0;
  $a = explode(' ', trim(fgets(STDIN)));
  for ($i = 0; $i < $n; $i++) {
    if ($a[$i] > $h) {
      $ans += 2;
    } else {
      $ans++;
    }
  }
  fprintf(STDOUT, "%d\n", $ans);
?>


<?

$stdin = fopen('php://stdin', 'r');
$s =  trim(fgets($stdin));
$ar = explode(" ",$s);
$amigos = $ar[0];
$h = $ar[1];

$s =  trim(fgets($stdin));
$heights = explode(" ",$s);
$w=$amigos;
foreach($heights as $height){
	if($height>$h){
		$w+=1;
	}
}
echo $w;

?>


<?php

$input = rtrim(fgets(STDIN));
$raw   = explode(' ', $input);
$countFriends = (int)$raw[0];
$fenceHeight  = (int)$raw[1];

$answer = 0;
$input = rtrim(fgets(STDIN));
$raw   = explode(' ', $input);
foreach ($raw as $height) {
    if ($height > $fenceHeight) {
        $answer += 2;
    } else {
        $answer += 1;
    }
}

echo $answer . PHP_EOL;


<?php
$friendsAndFencsHigth = fgets(STDIN);
$friedsHeight = fgets(STDIN);
$friedsHeight = trim($friedsHeight);
$friendsAndFencsHigth = trim($friendsAndFencsHigth);

$friedsHeight = explode(' ', $friedsHeight);
// тут массив высот друзей выглядит нормально

$friendsAndFencsHigth = explode(' ', $friendsAndFencsHigth);

// number of friends and height of fence should be a variables
list($howManyFriends, $fenceHeight) = $friendsAndFencsHigth;

$friedsHeight = array_map('intval', $friedsHeight);
$fenceHeight = intval($fenceHeight);

$roadWidth = 0;

for ($i=0; $i < $howManyFriends; $i++) {
	// а тут массив друзей вообще выдает Array1
	if($friedsHeight[$i] > $fenceHeight){
		$roadWidth += 2;
	} else {
		$roadWidth++;
	}
}

print_r($roadWidth);


<?
list($n,$h) = explode(' ', trim(fgets(STDIN)));
$arr = explode(' ', trim(fgets(STDIN)));
$ans = 0;
for($i=0; $i<$n; $i++)
 $ans +=$arr[$i] > $h ? 2: 1;
echo $ans;
?>


<?
$IN = fopen('php://stdin','r');
list($n,$h) = explode(' ', trim(fgets(STDIN)));
$arr = explode(' ', trim(fgets(STDIN)));
$ans = 0;
foreach($arr as $val)
 $ans +=$val > $h ? 2: 1;
print $ans;


<?php

$var =explode(" ", readline());
$arr =explode(" ", readline());
$count = 0;

foreach ($arr as  $value) {
	if ( $value <= $var[1]){
		$count++;
	}else{
		$count = $count+2;
	}
}
echo $count;


<?php

$zabor = explode(' ' , readline());
$length = explode(' ' , readline());

$counter = 0;

foreach($length as $elem) {
    if($elem > $zabor[1]) {
        $counter += 2;
    } else $counter++;
}
echo $counter;


<?php

$result = trim(fgets(STDIN));
list($n, $h) = explode(' ',$result);
$people = trim(fgets(STDIN));
$people = explode(' ', $people);
$w = 0;
foreach ($people as $p) {
    if ($p <= $h) {
        $w++;
    } else {
        $w += 2;
    }
}

echo $w . "\n";


<?php
  fscanf(STDIN,"%d %d",$n,$x);
  $ans=0;
  $a = explode(' ', trim(fgets(STDIN)));
  for($i=0;$i<$n;$i++){
	  $ans+= floor($a[$i]/$x);
	  if($a[$i]%$x!=0)
		  $ans++;
  }
  fprintf(STDOUT,"%d\n",$ans);
 ?>


from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().split(" "))
def msi(): return map(str,input().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
def c_one(a):
    nl=[-1]*len(a)
    for i in range(len(a)):
        if a[i]=='1':
            nl[i]=0
    return (nl)

def main():

    n,h=mi()
    a=li()
    c=0
    for i in range(len(a)):
        if a[i]<=h:
            c+=1
        else:
            c+=2
    print(c)
# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

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")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

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

# endregion

if __name__ == "__main__":
    #read()
    main()
    #dmain()

# Comment Read()


def nis():
    return map(int, raw_input().split())

n, h = nis()

A = nis()

w = 0
for a in A:
    if a <= h:
        w += 1
    else:
        w += 2

print w


n,h=map(int,raw_input().split())
a=map(int,raw_input().split())
z=n
for i in a:
    if i>h:
        z+=1
print z


n, h = map(int, raw_input().split())
print sum(map(lambda x: 1 + int(int(x)>h), raw_input().split()))


from __future__ import division
from sys import stdin, stdout

def write(x):
    stdout.write(str(x) + "\n")

n,h = map(int, stdin.readline().split())
a = map(int, stdin.readline().split())

res = 0

for num in a:
    if num > h:
        res += 2
    else:
        res += 1

write(res)


from __future__ import division
from sys import stdin, stdout

def write(x):
    stdout.write(str(x) + "\n")

n = int(stdin.readline())
for line in stdin.readlines():
    line = line.rstrip("\n")
    t = map(int, line.split())
    write(t)


n, h = map(int, raw_input().split())

a = map(int, raw_input().split())

res = 0
for i in range(n):
    if a[i] > h:
        res += 2
    else:
        res += 1

print res


#!/usr/bin/env python
#-*- coding:utf-8 -*-

import sys, math, random, operator
from string import ascii_lowercase
from string import ascii_uppercase
from fractions import Fraction, gcd
from decimal import Decimal, getcontext
from itertools import product, permutations, combinations
from Queue import Queue, PriorityQueue
from collections import deque, defaultdict, Counter
getcontext().prec = 100

MOD = 10**9 + 7
INF = float("+inf")

if sys.subversion[0] != "CPython":  # PyPy?
    raw_input = lambda: sys.stdin.readline().rstrip()
pr = lambda *args: sys.stdout.write(" ".join(str(x) for x in args) + "\n")
epr = lambda *args: sys.stderr.write(" ".join(str(x) for x in args) + "\n")
die = lambda *args: pr(*args) ^ exit(0)

read_str = raw_input
read_strs = lambda: raw_input().split()
read_int = lambda: int(raw_input())
read_ints = lambda: map(int, raw_input().split())
read_float = lambda: float(raw_input())
read_floats = lambda: map(float, raw_input().split())

"---------------------------------------------------------------"

n, h = read_ints()
arr = read_ints()

w = sum(1 if x <= h else 2 for x in arr)
print w


n, h = map(int, raw_input().split())
heights = list(map(int, raw_input().split()))
count = 0
for height in heights:
  if height > h:
    count += 1
print(n + count)


import sys
input = sys.stdin.readline

def inlt():
    return(list(map(int,input().split())))

def solve(p_hs, f_h):
  count = 0
  for p_h in p_hs:
    if p_h > f_h:
      count += 2
    else:
      count += 1
  return count

if __name__ == "__main__":
  i1 = inlt()
  i2 = inlt()
  print(solve(i2, i1[1]))


from sys import stdin

n, h = map(int, stdin.readline().split(" "))
heights = map(int, stdin.readline().split(" "))
taller = len(filter(lambda x: x > h, heights))
print(taller*2+(len(heights)-taller))


n, h = map(int, raw_input().split())
print sum( [1 for x in map(int, raw_input().split()) if x > h] ) + n


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>

using namespace std;
int gcd(int a,int b){
    if(!b)return a;
    return gcd(b,a%b);
}
int n;
int main(){
    srand(time(0));
    scanf("%d",&n);
    int g;
    int pos=rand()%(n+1);
    while(pos<=1)pos=rand()%(n+1);
    printf("? %d\n",pos);
    fflush(stdout);
    int x1,x2;
    scanf("%d",&x1);
    printf("? %d\n",pos-1);
    fflush(stdout);
    scanf("%d",&x2);
    g=abs(x1-x2);
    for(int i=1;i<=14;i++){
        pos=rand()%(n+1);
        while(pos<=1)pos=rand()%(n+1);
        printf("? %d\n",pos);
        fflush(stdout);
        scanf("%d",&x1);
        printf("? %d\n",pos-1);
        scanf("%d",&x2);
        g=gcd(g,abs(x1-x2));
    }
    int l=0,r=1e9,ans=0;
    for(int i=1;i<=30;i++){
        int mid=l+(r-l)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if(x==0){
            ans=mid;
            r=mid-1;
        }else{
            l=mid+1;
        }
    }
    printf("! %d %d\n",ans-(n-1)*g,g);

return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;
int gcd(int a,int b){
    if(!b)return a;
    return gcd(b,a%b);
}
int n;
int main(){
    srand(time(0));
    scanf("%d",&n);
    int g;
    int pos=rand()%(n+1);
    while(pos==0)pos=rand()%(n+1);
    printf("? %d\n",pos);
    fflush(stdout);
    scanf("%d",&g);

    for(int i=1;i<=29;i++){
        pos=rand()%(n+1);
        while(pos==0)pos=rand()%(n+1);
        printf("? %d\n",pos);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        g=gcd(x,g);
    }
    int l=0,r=1e9,ans=0;
    for(int i=1;i<=30;i++){
        int mid=l+(r-l)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if(x==0){
            ans=mid;
            r=mid-1;
        }else{
            l=mid+1;
        }
    }
    printf("! %d\n",ans-(n-1)*g);

return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;
int gcd(int a,int b){
    if(!b)return a;
    return gcd(b,a%b);
}
int n;
int main(){
    srand(time(0));
    scanf("%d",&n);
    int g;
    int pos=rand()%(n+1);
    while(pos==0)pos=rand()%(n+1);
    printf("? %d\n",pos);
    fflush(stdout);
    scanf("%d",&g);

    for(int i=1;i<=29;i++){
        pos=rand()%(n+1);
        while(pos==0)pos=rand()%(n+1);
        printf("? %d\n",pos);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        g=gcd(x,g);
    }
    int l=0,r=1e9,ans=0;
    for(int i=1;i<=29;i++){
        int mid=l+(r-l)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if(x==0){
            ans=mid;
            r=mid-1;
        }else{
            l=mid+1;
        }
    }
    printf("! %d\n",ans);

return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>

using namespace std;
int gcd(int a,int b){
    if(!b)return a;
    return gcd(b,a%b);
}
int n;
int main(){
    srand(time(NULL));
    scanf("%d",&n);
    int g;
    int pos=rand()*rand()%(n+1);
    while(pos<=1)pos=rand()*rand()%(n+1);
    printf("? %d\n",pos);
    fflush(stdout);
    int x1,x2;
    scanf("%d",&x1);
    printf("? %d\n",pos-1);
    fflush(stdout);
    scanf("%d",&x2);
    g=abs(x1-x2);
    for(int i=1;i<=14;i++){
        pos=rand()*rand()%(n+1);
        while(pos<=1)pos=rand()*rand()%(n+1);
        printf("? %d\n",pos);
        fflush(stdout);
        scanf("%d",&x1);
        printf("? %d\n",pos-1);
        fflush(stdout);
        scanf("%d",&x2);
        g=gcd(g,abs(x1-x2));
    }
    int l=0,r=1e9,ans=0;
    for(int i=1;i<=30;i++){
        int mid=l+(r-l)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if(x==0){
            ans=mid;
            r=mid-1;
        }else{
            l=mid+1;
        }
    }
    printf("! %d %d\n",ans-(n-1)*g,g);
    fflush(stdout);

return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>

using namespace std;
int gcd(int a,int b){
    if(!b)return a;
    return gcd(b,a%b);
}
int n;
int main(){
    srand(time(0));
    scanf("%d",&n);
    int g;
    int pos=rand()%(n+1);
    while(pos<=1)pos=rand()*rand()%(n+1);
    printf("? %d\n",pos);
    fflush(stdout);
    int x1,x2;
    scanf("%d",&x1);
    printf("? %d\n",pos-1);
    fflush(stdout);
    scanf("%d",&x2);
    g=abs(x1-x2);
    for(int i=1;i<=14;i++){
        pos=rand()*rand()%(n+1);
        while(pos<=1)pos=rand()*rand()%(n+1);
        printf("? %d\n",pos);
        fflush(stdout);
        scanf("%d",&x1);
        printf("? %d\n",pos-1);
        fflush(stdout);
        scanf("%d",&x2);
        g=gcd(g,abs(x1-x2));
    }
    int l=0,r=1e9,ans=0;
    for(int i=1;i<=30;i++){
        int mid=l+(r-l)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if(x==0){
            ans=mid;
            r=mid-1;
        }else{
            l=mid+1;
        }
    }
    printf("! %d %d\n",ans-(n-1)*g,g);
    fflush(stdout);

return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;
int main()
{
    int n;

    scanf("%d",&n);
    int l=0,r=1000000000;
    int maxx=-1,ti=60;
    while (l<r&&ti>0)
    {
        ti--;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x==1)
        {
            l=mid+1;
            maxx=max(maxx,mid+1);
        }
        else r=mid-1;
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    while (ti--)
    {
        while (1)
        {
            temp=mt()%(n+1);
            if (vis[temp]==0)
            {
                vis[temp]=1;
                break;
            }
        }
        printf("? %d\n",temp);
        fflush(stdout);
        scanf("%d",&num[tot++]);
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=__gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;
int main()
{
    int n;

    scanf("%d",&n);
    int l=0,r=1000000000;
    int maxx=-1,ti=0;
    while (l<r)
    {
        ti++;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x==1)
        {
            l=mid+1;
            maxx=max(maxx,mid+1);
        }
        else r=mid-1;
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    for (int q=ti;q<60;q++)
    {
        while (1)
        {
            temp=mt()%(n+1);
            if (vis[temp]==0)
            {
                vis[temp]=1;
                break;
            }
        }
        printf("%d\n",temp);
        fflush(stdout);
        scanf("%d",&num[tot++]);
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=__gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[maxn],tot,ti=60,maxx;

int gcd(int t1,int t2)
{
    return t2==0?t1:gcd(t2,t1%t2);
}

void find_Max(){
	int l = -1e9, r = 1e9;
	while(r >= l){
		int mid = (l + r) >> 1;
		printf("> %d\n", mid);
		fflush(stdout);
		int x; scanf("%d", &x);
		ti--;
		if(x) l = mid + 1;
		else r = mid - 1, maxx = mid;
	}
}

int main()
{
    int n;
    maxx=-1;

    scanf("%d",&n);
    find_Max();

    mt19937 mt;
    int temp=-1;
    tot=0;
    int tttt=n;
    int p=n;
    while (ti--&&p)
    {
        temp=mt()%p+1;
        printf("? %d\n",temp);
        vis[temp]=1;
        swap(vis[temp],vis[p]);
        p--;
        fflush(stdout);

        int wei;
        scanf("%d",&wei);
        if (wei==-1) continue;
        num[tot++]=wei;
    }
    int ans;
    sort(num,num+tot);

    ans=num[1]-num[0];
    for (int q=2;q<tot;q++)
    ans=gcd(ans,num[q]-num[q-1]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
int vis[maxn];
int num[maxn],tot,ti=60,maxx;

int gcd(int t1,int t2)
{
    return t2==0?t1:gcd(t2,t1%t2);
}

void find_Max(){
	int l = -1e9, r = 1e9;
	while(r >= l){
		int mid = (l + r) >> 1;
		printf("> %d\n", mid);
		fflush(stdout);
		int x; scanf("%d", &x);
		ti--;
		if(x) l = mid + 1;
		else r = mid - 1, maxx = mid;
	}
}

int main()
{
    int n;
    maxx=-1;

    scanf("%d",&n);
    find_Max();

    mt19937 mt;
    int temp=-1;
    tot=0;
    int tttt=n;
    int p=n;
    for (int q=0;q<n;q++)
    vis[q]=q+1;

    while (ti--&&p)
    {
        temp=mt()%p;

        printf("? %d\n",vis[temp]);
        swap(vis[temp],vis[p]);
        p--;
        fflush(stdout);

        int wei;
        scanf("%d",&wei);
        if (wei==-1) continue;
        num[tot++]=wei;
    }
    int ans;
    num[tot++]=maxx;
    sort(num,num+tot);
    tot=unique(num,num+tot)-num;

    ans=num[1]-num[0];
    for (int q=2;q<tot;q++)
    ans=gcd(ans,num[q]-num[q-1]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;

int gcd(int t1,int t2)
{
    return t2==0?t1:gcd(t2,t1%t2);
}
int main()
{
    int n;

    scanf("%d",&n);
    int l=-1e9,r=1e9;
    int maxx=-1,ti=60;
    while (l<=r)
    {
        ti--;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x)
        {
            l=mid+1;
        }
        else r=mid-1,maxx=mid;
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    int tttt=n;
    while (ti--&&tttt--)
    {
        temp=mt()%n+1;
        printf("? %d\n",temp);
        fflush(stdout);
        int wei;
        scanf("%d",&wei);
        if (wei==-1) continue;
        num[tot++]=wei;
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
int vis[maxn];
int num[maxn],tot,ti=60,maxx;

int gcd(int t1,int t2)
{
    return t2==0?t1:gcd(t2,t1%t2);
}

void find_Max(){
	int l = -1e9, r = 1e9;
	while(r >= l){
		int mid = (l + r) >> 1;
		printf("> %d\n", mid);
		fflush(stdout);
		int x; scanf("%d", &x);
		ti--;
		if(x) l = mid + 1;
		else r = mid - 1, maxx = mid;
	}
}

int main()
{
    int n;
    maxx=-1;

    scanf("%d",&n);
    find_Max();

    mt19937 mt;
    int temp=-1;
    tot=0;
    int tttt=n;
    int p=n;
    for (int q=0;q<n;q++)
    vis[q]=q+1;

    while (ti--&&p)
    {
        temp=mt()%p;

        printf("? %d\n",vis[temp]);
        swap(vis[temp],vis[p-1]);
        p--;
        fflush(stdout);

        int wei;
        scanf("%d",&wei);
        if (wei==-1) continue;
        num[tot++]=wei;
    }
    int ans;
    num[tot++]=maxx;
    sort(num,num+tot);
    tot=unique(num,num+tot)-num;

    ans=num[1]-num[0];
    for (int q=2;q<tot;q++)
    ans=gcd(ans,num[q]-num[q-1]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;
int main()
{
    int n;

    scanf("%d",&n);
    int l=-1e9,r=1e9;
    int maxx=-1,ti=60;
    while (l<=r)
    {
        ti--;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x)
        {
            l=mid+1;
        }
        else r=mid-1,maxx=max(maxx,mid);
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    while (ti--)
    {
        while (1)
        {
            temp=mt()%(n+1);
            if (vis[temp]==0)
            {
                vis[temp]=1;
                break;
            }
        }
        printf("? %d\n",temp);
        fflush(stdout);
        scanf("%d",&num[tot++]);
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=__gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[maxn],tot,ti=60,maxx;

int gcd(int t1,int t2)
{
    return t2==0?t1:gcd(t2,t1%t2);
}

void find_Max(){
	int l = -1e9, r = 1e9;
	while(r >= l){
		int mid = (l + r) >> 1;
		printf("> %d\n", mid);
		fflush(stdout);
		int x; scanf("%d", &x);
		ti--;
		if(x) l = mid + 1;
		else r = mid - 1, maxx = mid;
	}
}

int main()
{
    int n;
    maxx=-1;

    scanf("%d",&n);
    find_Max();

    mt19937 mt;
    int temp=-1;
    tot=0;
    int tttt=n;
    while (ti--)
    {
        temp=rand()%n+1;
        printf("? %d\n",temp);
        fflush(stdout);
        int wei;
        scanf("%d",&wei);
        if (wei==-1) continue;
        num[tot++]=wei;
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;
int main()
{
    int n;

    scanf("%d",&n);
    int l=0,r=1e9;
    int maxx=-1,ti=60;
    while (l<=r)
    {
        ti--;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x)
        {
            l=mid+1;
        }
        else r=mid-1,maxx=mid;
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    while (ti--)
    {

        temp=mt()%n+1;
        printf("? %d\n",temp);
        fflush(stdout);
        scanf("%d",&num[tot++]);
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=__gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

    system("pause");
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;
int main()
{
    int n;

    scanf("%d",&n);
    int l=0,r=1000000000;
    int maxx=-1,ti=0;
    while (l<r)
    {
        ti++;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x==1)
        {
            l=mid+1;
            maxx=max(maxx,mid+1);
        }
        else r=mid-1;
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    for (int q=ti;q<60;q++)
    {
        while (1)
        {
            temp=mt()%(n+1);
            if (vis[temp]==0)
            {
                vis[temp]=1;
                break;
            }
        }
        printf("? %d\n",temp);
        fflush(stdout);
        scanf("%d",&num[tot++]);
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=__gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

    system("pause");
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[maxn],tot,ti=60,maxx;

int gcd(int t1,int t2)
{
    return t2==0?t1:gcd(t2,t1%t2);
}

void find_Max(){
	int l = -1e9, r = 1e9;
	while(r >= l){
		int mid = (l + r) >> 1;
		printf("> %d\n", mid);
		fflush(stdout);
		int x; scanf("%d", &x);
		ti--;
		if(x) l = mid + 1;
		else r = mid - 1, maxx = mid;
	}
}

int main()
{
    int n;
    maxx=-1;

    scanf("%d",&n);
    find_Max();

    mt19937 mt;
    int temp=-1;
    tot=0;
    int tttt=n;
    while (ti--)
    {
        temp=mt()%n+1;
        printf("? %d\n",temp);
        fflush(stdout);
        int wei;
        scanf("%d",&wei);
        if (wei==-1) continue;
        num[tot++]=wei;
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


//My Conquest Is the Sea of Stars.
#pragma GCC diagnostic error "-std=c++11"
#include<bits/stdc++.h>
#define fi first
#define se second
#define gcd __gcd
#define pb push_back
#define mp make_pair
#define lowbit(x) x & (-x)
#define PII  pair<int, int>
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(__typeof(b) i = a; i <= (b); i++)
#define Rep(i, a, b) for(__typeof(a) i = a; i >= (b); i--)
#define FAST ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
typedef unsigned long long ull;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e6 + 5;
const ll INF = 0x3f3f3f3f3f3f3f3f;
using namespace std;

int n, res = 60, Max, D;
int id[maxn];
#define ff() fflush(stdout)
mt19937 rng((int)chrono::steady_clock::now().time_since_epoch().count());

void find_Max(){
	int l = -1e9, r = 1e9;
	while(r >= l){
		int mid = (l + r) >> 1;
		printf("> %d\n", mid);
		ff();
		int x; scanf("%d", &x);
		res--;
		if(x) l = mid + 1;
		else r = mid - 1, Max = mid;
	}
}

void find_D(){
	vector<int> v;
	rep(i, 0, n - 1) id[i] = i + 1;
	int t = n;
	while(res > 0 && t) {
		ll index = rng() % t;
		printf("? %d\n", id[index]);
		ff();
		int x; scanf("%d", &x);
		v.pb(x);
		res--; t--;
		swap(id[index], id[t]);
	}
	sort(all(v));
	if(v.back() != Max) v.pb(Max);
	int len = v.size();
	rep(i, 1, len - 1){
		D = __gcd(D, v[i] - v[i-1]);
	}
}

int main()
{
	scanf("%d", &n);
	find_Max();
	find_D();
	int Fi = Max - D * (n - 1);
	printf("! %d %d\n", Fi, D);
	ff();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;

int gcd(int t1,int t2)
{
    return t2==0?t1:gcd(t2,t1%t2);
}
int main()
{
    int n;

    scanf("%d",&n);
    int l=0,r=1e9;
    int maxx=-1,ti=60;
    while (l<=r)
    {
        ti--;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x)
        {
            l=mid+1;
        }
        else r=mid-1,maxx=mid;
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    int tttt=n;
    while (ti--&&tttt--)
    {
        temp=mt()%n+1;
        printf("? %d\n",temp);
        fflush(stdout);
        int wei;
        scanf("%d",&wei);
        if (wei==-1) continue;
        num[tot++]=wei;
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;
int main()
{
    int n;

    scanf("%d",&n);
    int l=-1e9,r=1e9;
    int maxx=-1,ti=60;
    while (l<=r)
    {
        ti--;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x)
        {
            l=mid+1;
        }
        else r=mid-1,maxx=max(maxx,mid);
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    while (ti--)
    {

        temp=mt()%n+1;
        printf("? %d\n",temp);
        fflush(stdout);
        scanf("%d",&num[tot++]);
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=__gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;
int main()
{
    int n;

    scanf("%d",&n);
    int l=-1e9,r=1e9;
    int maxx=-1,ti=60;
    while (l<=r)
    {
        ti--;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x)
        {
            l=mid+1;
        }
        else r=mid-1,maxx=max(maxx,mid);
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    while (ti--)
    {

        temp=mt()%(n+1);
        printf("? %d\n",temp);
        fflush(stdout);
        scanf("%d",&num[tot++]);
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=__gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
const ll mod = 1e9+7;
const ll INF=1e18;
bool vis[maxn];
int num[1000],tot;
int main()
{
    int n;

    scanf("%d",&n);
    int l=-1e9,r=1e9;
    int maxx=-1,ti=60;
    while (l<=r)
    {
        ti--;
        int mid=(l+r)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        if (x)
        {
            l=mid+1;
        }
        else r=mid-1,maxx=max(maxx,mid);
    }

    mt19937 mt;
    int temp=-1;
    tot=0;
    while (ti--)
    {

        temp=mt()%n;
        printf("? %d\n",temp);
        fflush(stdout);
        scanf("%d",&num[tot++]);
    }

    int ans=num[0];
    for (int q=1;q<tot;q++)
    ans=__gcd(ans,num[q]);

    printf("! %d %d\n",maxx-(n-1)*ans,ans);

    system("pause");
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll) % (ll)n * 998244353ll) % n + 1;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%d",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %d\n",mid);
		fflush(stdout);
		scanf("%d",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= 60 - cnt;i++){
		int x = Rand();
		int y = 0;
		while(vis[x] && y <= n){
		    x = x % n + 1;
		    y++;
		}
		vis[x] = 1;
		printf("? %d\n",x);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %d %d\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}

inline int read(){
    char ch=getchar();int x=0,f=0;
    while(ch<'0' || ch>'9') f|=ch=='-',ch=getchar();
    while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
    return f?-x:x;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	n = read();
	int l = 0,r = 1e9;
	    while(l<r){    //?????
        int mid=(l+r)>>1;
        printf("> %d\n",mid);
        cnt++;
        fflush(stdout);
        int res=read();
        if(res) l=mid+1;
        else r=mid;
    }
    mx = r;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand() % n + 1]);
	for(int i = 1;i <= min(n,60 - cnt);i++){
		printf("? %d\n",a[i]);
		fflush(stdout);
		res = read();
		ans = __gcd(ans,mx - res);
	}
	printf("! %d %d\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
	return ((rand() * 19260817ll + 20041006) % MOD1 ^ 998244353ll) % n + 1;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			scanf("%d",&res);
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %d %d\n",mi,(mx - mi) / (n - 1));
		fflush(stdout);
		return 0;
	}
	int l = 0,r = 1e9;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand()]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			scanf("%lld",&res);
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %lld %lld\n",mi,(mx - mi) / (n - 1));
		fflush(stdout);
		return 0;
	}
	int l = 0,r = 1e9;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand() % n + 1]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll + 20041006) % MOD1 ^ 998244353ll) % n + 1;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand()]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			scanf("%lld",&res);
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %lld %lld\n",mi,(mx - mi) / (n - 1));
		fflush(stdout);
		return 0;
	}
	int l = 0,r = 1e9;
    while(l<r){    //?????
        int mid=(l+r)>>1;
        printf("> %lld\n",mid);
        cnt++;
        fflush(stdout);
        scanf("%lld",&res);
        if(res) l=mid+1;
        else r=mid;
    }
    mx = r;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand() % n + 1]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
	return ((rand() * 19260817ll + 20041006) % MOD1 ^ 998244353ll) % n + 1;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			scanf("%d",&res);
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %d %d\n",mi,(mx - mi) / (n - 1));
		return 0;
	}
	int l = 0,r = 1e9;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand()]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll) % n * rand() % n * 998244353ll) % n + 1;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= 60 - cnt;i++){
		int x = Rand();
		int y = 0;
		while(vis[x] && y <= n){
		    x = x % n + 1;
		    y++;
		}
		vis[x] = 1;
		printf("? %lld\n",x);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
	return ((rand() * 19260817ll + 20041006) % MOD1 ^ 998244353ll) % n + 1;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			scanf("%lld",&res);
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %lld %lld\n",mi,(mx - mi) / (n - 1));
		fflush(stdout);
		return 0;
	}
	int l = 0,r = 1e9;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand()]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


// luogu-judger-enable-o2
/*
Problem : CF 1114E
Algorithm : ???? + ???
Status : AC
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e6 + 5;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll) % (ll)n * 998244353ll) % n + 1;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%d",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %d\n",mid);
		fflush(stdout);
		scanf("%d",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= 60 - cnt;i++){
		int x = Rand();
		int y = 0;
		while(vis[x] && y <= n){
		    x = x % n + 1;
		    y++;
		}
		vis[x] = 1;
		printf("? %d\n",x);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %d %d\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			scanf("%lld",&res);
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %lld %lld\n",mi,(mx - mi) / (n - 1));
		fflush(stdout);
		return 0;
	}
	int l = 0,r = 1e9;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand() % n + 1]);
	for(int i = 1;i <= min(n,60 - cnt);i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%lld",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll + 20041006) % MOD1 ^ 998244353ll) % n + 1;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= 60 - cnt;i++){
		int x = Rand();
		int y = 0;
		while(vis[x] && y <= n){
		    x = x % n + 1;
		    y++;
		}
		vis[x] = 1;
		printf("? %lld\n",x);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			scanf("%lld",&res);
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %lld %lld\n",mi,(mx - mi) / (n - 1));
		fflush(stdout);
		return 0;
	}
	int l = 0,r = 1e9;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand() % n + 1]);
	for(int i = 1;i <= min(n,60 - cnt);i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}

inline int read(){
    char ch=getchar();int x=0,f=0;
    while(ch<'0' || ch>'9') f|=ch=='-',ch=getchar();
    while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
    return f?-x:x;
}
int gcd(int x,int y){
    return y?gcd(y,x%y):x;
}
int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	n = read();
	int l = 0,r = 1e9;
	    while(l<r){    //?????
        int mid=(l+r)>>1;
        printf("> %d\n",mid);
        cnt++;
        fflush(stdout);
        int res=read();
        if(res) l=mid+1;
        else r=mid;
    }
    mx = r;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand() % n + 1]);
	for(int i = 1;i <= min(n,60 - cnt);i++){
		printf("? %d\n",a[i]);
		fflush(stdout);
		res = read();
		ans = gcd(ans,mx - res);
	}
	printf("! %d %d\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll) % (ll)n * 998244353ll) % n + 1;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%d",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %d\n",mid);
		fflush(stdout);
		scanf("%d",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	for(int i = 1;i <= 60 - cnt;i++){
		int x = Rand();
		if(vis[x])
		    x = x % n + 1;
		vis[x] = 1;
		printf("? %d\n",x);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %d %d\n",mx - (ans - 1) * n,ans);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ???? + ???
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e6 + 5;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll) % (ll)n * 998244353ll) % n + 1;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%d",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %d\n",mid);
		fflush(stdout);
		scanf("%d",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= 60 - cnt;i++){
		int x = Rand();
		int y = 0;
		while(vis[x] && y <= n){
		    x = x % n + 1;
		    y++;
		}
		vis[x] = 1;
		printf("? %d\n",x);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %d %d\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll) % (ll)n * 998244353ll) % n + 1;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%d",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %d\n",mid);
		fflush(stdout);
		scanf("%d",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= 40 - cnt;i++){
		int x = Rand();
		int y = 0;
		while(vis[x] && y <= n){
		    x = x % n + 1;
		    y++;
		}
		vis[x] = 1;
		printf("? %d\n",x);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %d %d\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;

int n,ans,cnt,res;

int Rand(){
	return ((rand() * 19260817ll) % (ll)n * 998244353ll) % n + 1;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
	scanf("%d",&ans);
	int l = 1,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %d\n",mid);
		fflush(stdout);
		scanf("%d",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	for(int i = 1;i <= 60 - cnt;i++){
		int x = Rand();
		printf("? %d\n",x);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("%d %d\n",mx - (ans - 1) * n,ans);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=1000100;
#define MP make_pair
#define PB push_back
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define MEM(x,v) memset(x,v,sizeof(x))
inline int read(){
    char ch=getchar();int x=0,f=0;
    while(ch<'0' || ch>'9') f|=ch=='-',ch=getchar();
    while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
    return f?-x:x;
}
int n,cnt,pt[maxn];
inline int rnd(){    //???rand
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}
int gcd(int x,int y){
    return y?gcd(y,x%y):x;
}
int main(){
    n=read();
    if(n<=60){    //n<=60,???
        int mx=0,mn=INT_MAX;
        FOR(i,1,n){
            printf("? %d\n",i);
            fflush(stdout);
            int x=read();
            mx=max(mx,x);
            mn=min(mn,x);
        }
        printf("! %d %d\n",mn,(mx-mn)/(n-1));
        fflush(stdout);
        return 0;
    }
    int l=0,r=1e9;
    while(l<r){    //?????
        int mid=(l+r)>>1;
        printf("> %d\n",mid);
        cnt++;
        fflush(stdout);
        int ver=read();
        if(ver) l=mid+1;
        else r=mid;
    }
    int mx=r,ans=0;
    FOR(i,1,n) pt[i]=i;
    FOR(i,1,n) swap(pt[i],pt[rnd()%n+1]);
    FOR(i,1,min(n,60-cnt)){    //??60-cnt???
        printf("? %d\n",pt[i]);
        fflush(stdout);
        int x=read();
        ans=gcd(ans,mx-x);    //?gcd
    }
    printf("! %d %d\n",mx-(n-1)*ans,ans);    //??=??-(??-1)*??
    fflush(stdout);
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res;
int vis[MAXN],a[MAXN];

int Rand(){
	return ((rand() * 19260817ll + 20041006) % MOD1 ^ 998244353ll) % n + 1;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand()]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			scanf("%lld",&res);
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %lld %lld\n",mi,(mx - mi) / (n - 1));
		fflush(stdout);
		return 0;
	}
	int l = 0,r = 1e9;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand()]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%d",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm : ���� + ���
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res,mi = 1e9,mx;
int vis[MAXN],a[MAXN];

int Rand(){
    static int seed=2333;
    return seed=(((seed*666666ll+20050818)%998244353)^1000000007)%1004535809;
}

inline int read(){
    char ch=getchar();int x=0,f=0;
    while(ch<'0' || ch>'9') f|=ch=='-',ch=getchar();
    while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
    return f?-x:x;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	n = read();
	if(n <= 60){
		for(int i = 1;i <= n;i++){
			printf("? %d\n",i);
			fflush(stdout);
			res = read();
			mi = min(mi,res);
			mx = max(mx,res);
		}
		printf("! %d %d\n",mi,(mx - mi) / (n - 1));
		fflush(stdout);
		return 0;
	}
	int l = 0,r = 1e9;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %d\n",mid);
		fflush(stdout);
		res = read();
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand() % n + 1]);
	for(int i = 1;i <= min(n,60 - cnt);i++){
		printf("? %d\n",a[i]);
		fflush(stdout);
		res = read();
		ans = __gcd(ans,mx - res);
	}
	printf("! %d %d\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


/*
Problem : CF 1114E
Algorithm :
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e6 + 5;
const int MOD1 = 10000019;

int n,ans,cnt,res;
int vis[MAXN];

int Rand(){
	return ((rand() * 19260817ll + 20041006) % MOD1 ^ 998244353ll) % n + 1;
}

signed main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    srand(time(NULL));
	scanf("%lld",&n);
	int l = 0,r = 1e9,mx = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		printf("> %lld\n",mid);
		fflush(stdout);
		scanf("%lld",&res);
		if(res){
			l = mid + 1;
			mx = mid;
		}else
		    r = mid - 1;
		cnt++;
	}
	mx++;
	for(int i = 1;i <= n;i++)
	    a[i] = i;
	for(int i = 1;i <= n;i++)
	    swap(a[i],a[Rand()]);
	for(int i = 1;i <= 60 - cnt;i++){
		printf("? %lld\n",a[i]);
		fflush(stdout);
		scanf("%lld",&res);
		ans = __gcd(ans,mx - res);
	}
	printf("! %lld %lld\n",mx - ans * (n - 1),ans);
	fflush(stdout);
	return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(0));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        for(int i=1;i<=remaining;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            if(v[i]==Max)
                continue;
            if(r==-1)
                r=Max-v[i];
            else
                r=gcd(r,Max-v[i]);
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(0));
    scanf("%d",&N);
    /*if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {*/
        Max=binsearch()+1;
        for(int i=1;i<=remaining;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            if(v[i]==Max)
                continue;
            if(r==-1)
                r=Max-v[i];
            else
                r=gcd(r,Max-v[i]);
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    //}
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(0));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            return 0;
        }
        for(int i=1;i<=remaining-2;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            if(v[i]==Max)
                continue;
            if(r==-1)
                r=Max-v[i];
            else
                r=gcd(r,Max-v[i]);
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-2,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(123456);
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            fflush(stdout);
            return 0;
        }
        v[1]=Max;
        for(int i=2;i<remaining;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            for(int j=1;j<i;j++)
            {
                if(v[i]==v[j])
                {
                    continue;
                }
                if(r==-2)
                {
                    r=abs(v[j]-v[i]);
                }
                else
                {
                    r=gcd(r,abs(v[j]-v[i]));
                }
            }
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(0));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            return 0;
        }
        for(int i=1;i<=remaining-2;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            if(v[i]==Max)
                continue;
            if(r==-1)
                r=Max-v[i];
            else
                r=gcd(r,Max-v[i]);
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=0,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(0));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            return 0;
        }
        for(int i=1;i<=remaining-2;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            if(v[i]==Max)
                continue;
            if(r==-1)
                r=Max-v[i];
            else
                r=gcd(r,Max-v[i]);
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(123456);
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            fflush(stdout);
            return 0;
        }
        v[1]=Max;
        for(int i=2;i<remaining;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            for(int j=1;j<i;j++)
            {
                if(v[i]==v[j]||v[i]!=-1)
                    continue;
                if(r==-1)
                    r=v[j]-v[i];
            else
                r=gcd(r,v[j]-v[i]);
            }
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(0));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            fflush(stdout);
            return 0;
        }
        for(int i=1;i<=remaining-2;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            if(v[i]==Max&&v[i]!=-1)
                continue;
            if(r==-1)
                r=Max-v[i];
            else
                r=gcd(r,Max-v[i]);
        }
        printf("! %d %d\n",Max-N*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-2,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(NULL));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            fflush(stdout);
            return 0;
        }
        v[1]=Max;
        int start=min(rand()%N+1,N-40);
        for(int i=2;i<remaining;i++)
        {
            printf("? %d\n",start++);
            fflush(stdout);
            scanf("%d",&v[i]);
            for(int j=1;j<i;j++)
            {
                if(v[i]==v[j])
                {
                    continue;
                }
                if(r==-2)
                {
                    r=abs(v[j]-v[i]);
                }
                else
                {
                    r=gcd(r,abs(v[j]-v[i]));
                }
            }
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(123456);
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            fflush(stdout);
            return 0;
        }
        v[1]=Max;
        for(int i=1;2<=remaining-2;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            for(int j=1;j<i;j++)
            {
                if(v[i]==v[j]||v[i]!=-1)
                    continue;
                if(r==-1)
                    r=v[j]-v[i];
            else
                r=gcd(r,v[j]-v[i]);
            }
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-2,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(NULL));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            fflush(stdout);
            return 0;
        }
        v[1]=Max;
        for(int i=2;i<remaining;i++)
        {
            printf("? %d\n",(rand()%1000+1)*(rand()%1000+1)*(rand()%1000+1)%N+1);
            fflush(stdout);
            scanf("%d",&v[i]);
            for(int j=1;j<i;j++)
            {
                if(v[i]==v[j])
                {
                    continue;
                }
                if(r==-2)
                {
                    r=abs(v[j]-v[i]);
                }
                else
                {
                    r=gcd(r,abs(v[j]-v[i]));
                }
            }
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-2,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(NULL));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            fflush(stdout);
            return 0;
        }
        v[1]=Max;
        for(int i=2;i<remaining;i++)
        {
            printf("? %d\n",1+rand()%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            for(int j=1;j<i;j++)
            {
                if(v[i]==v[j])
                {
                    continue;
                }
                if(r==-2)
                {
                    r=abs(v[j]-v[i]);
                }
                else
                {
                    r=gcd(r,abs(v[j]-v[i]));
                }
            }
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>

#define MaxN 100
#define INF 2140000000LL

using namespace std;

int Max,r=-1,Min,N,v[MaxN],remaining=60;

int gcd(int a,int b)
{
    if(b==0)
        return a;
    else return gcd(b,a%b);
}

int binsearch()
{
    int lw=0,hi=1000000000,last=-1,val;
    while(lw<=hi)
    {
        remaining--;
        int mid=(lw+hi)/2;
        printf("> %d\n",mid);
        fflush(stdout);
        scanf("%d",&val);
        if(val)
        {
            last=mid;
            lw=mid+1;
        }
        else
        {
            hi=mid-1;
        }
    }
    return last;
}

int main()
{
    srand(time(0));
    scanf("%d",&N);
    if(N<=60)
    {
        for(int i=1;i<=N;i++)
        {
            printf("? %d\n",i);
            fflush(stdout);
            scanf("%d",&v[i]);
        }
        sort(v+1,v+1+N);
        printf("! %d %d\n",v[1],v[2]-v[1]);
        fflush(stdout);
    }
    else
    {
        Max=binsearch()+1;
        int a,b;
        printf("? 1\n");
        fflush(stdout);
        scanf("%d",&a);
        printf("? 2\n");
        fflush(stdout);
        scanf("%d",&b);
        if(a==b)
        {
            printf("! %d 0\n",Max);
            fflush(stdout);
            return 0;
        }
        for(int i=1;i<=remaining-2;i++)
        {
            printf("? %d\n",1+(5+rand())%N);
            fflush(stdout);
            scanf("%d",&v[i]);
            if(v[i]==Max&&v[i]!=-1)
                continue;
            if(r==-1)
                r=Max-v[i];
            else
                r=gcd(r,Max-v[i]);
        }
        printf("! %d %d\n",Max-(N-1)*r,r);
        fflush(stdout);
    }
    return 0;
}