Harryxun/stf_run huggingface dataset:
import math

a, b, x = map(int, input().split())

t = a*a*b

if x <= t*0.5:
    tan = 2*x/(a*b*b)
    theta = math.degrees(math.atan(tan))
else:
    tan = a*a*a/(2*(a*a*b - x))
    theta = math.degrees(math.atan(tan))

print(90 - theta)

### FIXED CODE ###

import math

a, b, x = map(int, input().split())

t = a*a*b

if x == t:
    theta = 90
elif x <= t*0.5:
    tan = 2*x/(a*b*b)
    theta = math.degrees(math.atan(tan))
else:
    tan = a*a*a/(2*(a*a*b - x))
    theta = math.degrees(math.atan(tan))

print(90 - theta)
a = input()
b = input()

ans = "EQUAL"
la, lb = len(a), len(b)
if la < lb:
  ans = "LESS"
elif la > lb:
  ans = "GREATER"
else:
  for i in range(n):
    if a[i] < b[i]:
      ans = "LESS"
      break
  	elif a[i] > b[i]:
      ans = "GREATER"
      break
print(ans)

### FIXED CODE ###


a = input()
b = input()
	
ans = "EQUAL"
la, lb = len(a), len(b)
if la < lb:
	ans = "LESS"
elif la > lb:
	ans = "GREATER"
else:
	for i in range(la):
		if a[i] < b[i]:
			ans = "LESS"
			break
		elif a[i] > b[i]:
			ans = "GREATER"
			break
print(ans)
import fractions
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
def func(x,y):
    return (x*y)//fractions.gcd(x,y)
AB = reduce(func, A, 1)
sumB = 0
for ii in range(N):
    sumB += int(AB/A[ii])%(10**9+7)
print(int(sumB%(10**9+7)))

### FIXED CODE ###

import fractions
N = int(input())
A = list(map(int, input().split()))
AB = 1
for i in A:
    AB = AB*i//fractions.gcd(AB,i)
sumB = 0
for i in A:
    sumB += AB//i
print(int(sumB%(10**9+7)))
a,b,c = list(map(int,input()))
if a + b < c:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

a,b,c = list(map(int,input().split()))
if a + b < c:
  print("No")
else:
  print("Yes")
a,b = list(map(int, input().split))

print(a*b)

### FIXED CODE ###

import math
from collections import deque
from collections import defaultdict

import time

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b = readInts()

print(a*b)
s=input()
t=input()
if s==t[:-1]
	print("Yes")
else:
  	print("No")

### FIXED CODE ###

s=input()
t=input()
if s==t[:-1]:
	print("Yes")
else:
  	print("No")
B = input()
order = True
F = ""
for q in range(int(input())):
    T = input().rstrip().split()
    if T[0] == "1":
        order ^= True
    else:
        f,c = T[1],T[2]
        if not((f == "1") ^ order):
            F += c
        else:
            B += c
    print(F,B)
F = F[::-1]+B
if not order:
    F = F[::-1]
print(F)

### FIXED CODE ###

B = input()
order = True
F = ""
for q in range(int(input())):
    T = input().rstrip().split()
    if T[0] == "1":
        order ^= True
    else:
        f,c = T[1],T[2]
        if not((f == "1") ^ order):
            F += c
        else:
            B += c
    #print(F,B)
F = F[::-1]+B
if not order:
    F = F[::-1]
print(F)
# -*- coding: utf-8 -*-

n = int(input())

if (n / 1000) == 0:
    print('ABC' + n % 1000)
else:
    print('ABD' + (n % 1000) + 1)

### FIXED CODE ###

# -*- coding: utf-8 -*-

n = int(input())

if (n // 1000) == 0:
    print('ABC')
else:
    print('ABD')
a = int(input())
b = int(input())
c = int(input())
 
print((a+b+c)-max(a,b,c))

### FIXED CODE ###

a = [i for i in input().split()]
print(int(sorted(a)[0]) + int(sorted(a)[1]))
N, A, B = map(int, input().split())

ans = 0
#print(int(N/(A+B)))
for i in range(1, int(N/(A+B))+1):
    ans = ans + A

r = N-(A+B)*i
#print(r)

if r <= A:
    ans = ans + r
else:
    ans = ans + A

print(ans)


### FIXED CODE ###


N, A, B = map(int, input().split())

ans = 0
S=A+B
Q=int(N/S)
#print(int(N/(A+B)))
#for i in range(1, int(N/(A+B))+1):
#    ans = ans + A
ans = Q*A

r = N-Q*S
#print(r)

if r <= A:
    ans = ans + r
else:
    ans = ans + A

print(ans)
import numpy as np
n,k,q=map(int,input().split())
a=[int(input()) for i in range(Q)]
li=np.array([0]*n)
d=np.array([k-q]*n)
for j in range(0,len(a)):
    li[a[j]-1]+=1

    
ans=np.array(li+d)
print(ans)
for m in range(0,n):
    if ans[m]>0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

import numpy as np
n,k,q=map(int,input().split())
a=[int(input()) for i in range(q)]
li=np.array([0]*n)
d=np.array([k-q]*n)

for j in range(0,len(a)):
  li[a[j]-1]+=1

  
ans=np.array(li+d)


for m in range(0,n):
  if ans[m]>0:
    print("Yes")
  else:
    print("No")
a=input()
if(a[len(a)-1]=="s"):
	a.append("e")
print(a+"s")

### FIXED CODE ###

a=input()
if(a[len(a)-1]=="s"):
	a+="e"
print(a+"s")
n = int(input())
ans = 1
for i in range(1,n+1):
    ans=ans*i%(1e9+7)

print(int(ans)

### FIXED CODE ###

n = int(input())
ans = 1
for i in range(1,n+1):
    ans=ans*i%(1e9+7)

print(int(ans))
from fractions import gcd

N, M = map(int, input().split())
A = list(map(int, input().split()))

# A = list(set(A))

def lcm(x, y):
    return (x * y) // gcd(x, y)

p = lcm(A[0]//2, A[1]//2)
q = lcm(A[0], A[1])
for i in range(1, N-1):
    print(i)
    p = lcm(p, A[i]//2)
    q = lcm(q, A[i])
# print(p, q)

n = ((M - p) / q) + 1
print(int(n))

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))

half = [i//2 for i in A]

def f(v):
    r = 0
    while v % 2 == 0:
        v /= 2
        r += 1
    return r

from fractions import gcd
def f2(x, y):
    return (x * y) // gcd(x, y)

d = f(A[0])
for ai in A:
    if d != f(ai):
        print(0)
        break
else:
    lcm = 1
    for ai in half:
        lcm = f2(lcm, ai)

    r = M // lcm
    ans = (r + 1) // 2
    print(ans)
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string



INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


n, k = LI()
dp = [[[0] * (n * (n + 1)) for _ in range(n + 1)] for _ in range(n + 1)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(i+1):
        for l in range(k + 1):
            dp[i + 1][j + 1][l+2*(j + 1)] += dp[i][j][l]
            dp[i + 1][j][l+2*j] += dp[i][j][l]*(j*2+1)
            if j != 0:
                dp[i+1][j-1][l+(j-1)*2] += dp[i][j][l]*j*j

print(dp)
print(dp[n][0][k]%mod)


### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string



INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


n, k = LI()
dp = [[[0]*n**2*4 for _ in range(n+1)] for _ in range(n+1)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(i+1):
        for l in range(k+1):
            dp[i+1][j+1][l+2*(j+1)] += dp[i][j][l]
            dp[i+1][j+1][l+2*(j+1)]%=mod
            dp[i+1][j][l+2*j] += dp[i][j][l]*(j*2+1)
            dp[i+1][j][l+2 * j] %= mod
            if j!= 0:
                dp[i+1][j-1][l+(j-1)*2] += dp[i][j][l]*j*j
                dp[i+1][j-1][l+(j-1)*2]%=mod



print(dp[n][0][k]%mod)
n,d = map(int, input())

count = 0
for t in range(n):
  x,y = map(int, input())
  if x*x + y*y <= d*d:
    count += 1

print(count)

### FIXED CODE ###

n,d = map(int, input().split(" "))

count = 0
for t in range(n):
  x,y = map(int, input().split(" "))
  if x*x + y*y <= d*d:
    count += 1

print(count)
import collections

s = input()
k = int(input())
b = collections.Counter(s)
c = sorted(b.items())
con = []
n = 0
while True:
    con.append(c[n][0])
    if len(con) >= k:
        break
    for i in range(len(c)):
        check = c[n][0] + c[i][0]
        if check in s:
            con.append(check)
            if len(con) >= k:
                break
            for i_2 in range(len(c)):
                check_2 = check + c[i_2][0]
                if check_2 in s:
                    con.append(check_2)
                    if len(con) >= k:
                        break
                    for i_3 in range(len(c)):
                        check_3 = check_2 + c[i_3][0]
                        if check_3 in s:
                            con.append(check_3)
                            if len(con) >= k:
                                break
                            for i_4 in range(len(c)):
                                check_4 = check_3 + c[i_4][0]
                                if check_4 in s:
                                    con.append(check_4)
                                    if len(con) >= k:
                                        break
    n +=1
print(con[k-1])

### FIXED CODE ###

import collections

s = input()
k = int(input())
b = collections.Counter(s)
c = sorted(b.items())
con = []
n = 0
while True:
    con.append(c[n][0])
    if len(con) == k:
        break
    for i in range(len(c)):
        check = c[n][0] + c[i][0]
        if check in s:
            con.append(check)
            if len(con) >= k:
                break
            for i_2 in range(len(c)):
                check_2 = check + c[i_2][0]
                if check_2 in s:
                    con.append(check_2)
                    if len(con) >= k:
                        break
                    for i_3 in range(len(c)):
                        check_3 = check_2 + c[i_3][0]
                        if check_3 in s:
                            con.append(check_3)
                            if len(con) >= k:
                                break
                            for i_4 in range(len(c)):
                                check_4 = check_3 + c[i_4][0]
                                if check_4 in s:
                                    con.append(check_4)
                                    if len(con) >= k:
                                        break
    if len(con) >= k:
        break                              
    n +=1
print(con[k-1])
N, K = map(int, input().split())
P = [int(i) - 1 for i in input().split()]
Q = [int(i) for i in input().split()]
ans = - float('inf')
for i in range(N):
    tmp = []
    now = i
    cnt = 0
    for j in range(1, N + 1):
        now = P[now]
        cnt += Q[now]
        tmp.append(cnt)
        if now == i:
            break
    if tmp[-1] < 0:
        ans = max(ans, max(tmp))
    else:
        v = (tmp[-1] * (K // j)) + max(tmp[:K % j])
        ans = max(ans, v)
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
P = [int(i) - 1 for i in input().split()]
Q = [int(i) for i in input().split()]
ans = - float('inf')
for i in range(N):
    now = i
    cnt = 0
    span = 0
    while True:
        span += 1
        cnt += Q[now]
        now = P[now]
        if now == i:
            break
    point = 0
    now = i
    for j in range(1, span + 1):
        point += Q[now]
        now = P[now]       
        if j > K:
            break
        value = point + (max(cnt, 0) * ((K - j) // span))
        ans = max(ans, value)
print(ans)
import collections
n = int(input())
a = [int(i) for i in input().split()]
b = collections.Counter(a)
ans = "No"
if (len(b) == 3):
    if (list(b.keys())[0] ^ list(b.keys())[1] ^ list(b.keys())[2]) == 0:
        ans = "Yes"
elif (len(b) == 1):
    if list(k.keys())[0] == 0:
        ans = "Yes"
print(ans)

### FIXED CODE ###

import collections
n = int(input())
a = [int(i) for i in input().split()]
b = collections.Counter(a)
ans = "No"
if (len(b) == 3):
    if (list(b.keys())[0] ^ list(b.keys())[1] ^ list(b.keys())[2]) == 0:
        if ((list(b.values())[0] == list(b.values())[1]) & (list(b.values())[0] == list(b.values())[2])):
            ans = "Yes"
elif (len(b) == 1):
    if list(b.keys())[0] == 0:
        ans = "Yes"
elif (len(b) == 2):
    if (n % 3 == 0):
        dd = list(b.keys())
        dd.sort()
        if (dd[0] == 0) & ((b[0] * 2) == (b[dd[1]])):
            ans = "Yes"
print(ans)
n = input()

a = n[0]
b = n[1:]

if (int(b)+1) % (10 ** len(b)) == 0:
    flag = True
else:
    flag = False

if flag:
    ans = int(a) + 9 * len(b)
else:
    ans = int(a) - 1 + 9 * len(b)

print(ans)

### FIXED CODE ###

n = input()

a = n[0]

if len(n) > 1:
    b = n[1:]
    if (int(b)+1) % (10 ** len(b)) == 0:
        flag = True
    else:
        flag = False
else:
    b = ''
    flag = True

if flag:
    ans = int(a) + 9 * len(b)
else:
    ans = int(a) - 1 + 9 * len(b)

print(ans)
n = int(input())
x = input()

c1 = x.count('1')
cc1 = int('0b' + x, 0) % (c1 - 1)
cc2 = int('0b' + x, 0) % (c1 + 1)

def f(n):
    ans = 0
    while n > 0:
        ans += 1
        n = n % bin(n).count('1')
    return ans

for i in range(n):
    if x[i] == '1':
        print(f((pow(2, n-i-1, c1-1) + cc1) % (c1 - 1)) + 1)
    else:
        print(f((pow(2, n-i-1, c1+1) + cc2) % (c1 + 1)) + 1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

n = int(input())
x = input()

c1 = x.count('1')
if c1 > 1:
    cc1 = int('0b' + x, 0) % (c1 - 1)
cc2 = int('0b' + x, 0) % (c1 + 1)

def f(n):
    ans = 0
    while n > 0:
        ans += 1
        n = n % bin(n).count('1')
    return ans

if c1 == 1:
    for i in range(n):
        if x[i] == '1':
            print(0)
        else:
            print(f((pow(2, n-i-1, c1+1) + cc2) % (c1 + 1)) + 1)
    exit()

for i in range(n):
    if x[i] == '1':
        print(f((-pow(2, n-i-1, c1-1) + cc1) % (c1 - 1)) + 1)
    else:
        print(f((pow(2, n-i-1, c1+1) + cc2) % (c1 + 1)) + 1)
import numpy as np
import math

A, B, C, D = map(int, input().split())

BA = np.arange(A, B+1)
BA_C = BA % C
BA_D = BA % D
BA_CD = BA % (C * D//math.gcd(C, D))

C_count = np.count_nonzero(BA_C == 0)
D_count = np.count_nonzero(BA_D == 0)
CD_count = np.count_nonzero(BA_CD == 0)

print(len(BA)-(C_count+D_count-CD_count))

### FIXED CODE ###

from fractions import gcd

A, B, C, D = map(int, input().split())
l = C * D // gcd(C, D)
x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l
y = B - B // C - B // D + B // l
print(y - x)
#def make_divisors(n,m):
#    divisors = []
#    for i in range(1, int(min(n,m)**0.5)+1):
#        if n % i == 0 and m%i == 0:
#            divisors.append(i)
#            if i != min(n,m) // i:
#                divisors.append(min(n,m)//i)
#
#    # divisors.sort()
#    return divisors

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
#            if i != n // i:
#                divisors.append(n//i)

    # divisors.sort()
    return divisors

C = make_divisors(A)
D = make_divisors(B)
C.sort()
D.sort()
E = []

idx1 = 0
idx2 = 0
L = min(len(C),len(D))
while idx1 < L and idx2 < L:
    if C[idx1] == D[idx2] :
        E.append(C[idx1])
        idx1 += 1
        idx2 += 1
    elif C[idx1] > D[idx2]:
        idx2 += 1
    else:
        idx1 += 1
        
        
memo = [False] * (10**6+10)
ans = 0
for e in E:
    if not(memo[e]):
        ans += 1
        j = e
        if e == 1:continue
        while j < len(memo):
            memo[j] = True
            j += e

print(ans)            
        
        



### FIXED CODE ###


A,B = map(int,input().split())
from fractions import gcd 

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

C = gcd(A,B)
E = make_divisors(C)
E.sort()

sosuu = []
ans = 0
for e in E:
    if e == 1:continue
    for s in sosuu:
        if e%s == 0:
            break
    else:
        sosuu.append(e)

print(len(sosuu)+1)
wimport numpy as np

n = int(raw_input())
data = map(int, raw_input().split())
m = int(raw_input())
test = map(int, raw_input().split())

# def solve(i,left):
#     if left == 0:
#         return True
#     elif i >= n:
#         return False
#     return solve(i+1, left) or solve(i+1, left - data[i])

# for j in range(m):
#     if solve(0, test[j]):
#         print 'yes'
#     else:
#         print 'no'

a = [0]
for i in range(n):
    a = a + [a[j] + data[i] for j in range(len(a))]

for i in range(m):
    if test[i] in a:
        print 'yes'
    else:
        print 'no'
        

### FIXED CODE ###

n = int(raw_input())
data = map(int, raw_input().split())
m = int(raw_input())
test = map(int, raw_input().split())

# def solve(i,left):
#     if left == 0:
#         return True
#     elif i >= n:
#         return False
#     return solve(i+1, left) or solve(i+1, left - data[i])

# for j in range(m):
#     if solve(0, test[j]):
#         print 'yes'
#     else:
#         print 'no'

a = [0]
for i in range(n):
    a = a + [a[j] + data[i] for j in range(len(a))]

for i in range(m):
    if test[i] in a:
        print 'yes'
    else:
        print 'no'
n=int(input())
h=list(map(int, input().split()))
c=0
if n!=1:
    for i in reversed(range(n-1)):
        if h[i]==h[i+1]+1:
            h[i]-=1
        elif h[i]-h[i+1]>=2:
            c=1
    if c==1:
        print("Yes")
    else:
        prin("No")
else:
    print("Yes")
            

### FIXED CODE ###

n=int(input())
h=list(map(int, input().split()))
c=0
if n!=1:
    for i in reversed(range(n-1)):
        if h[i]==h[i+1]+1:
            h[i]-=1
        elif h[i]-h[i+1]>=2:
            c=1
    if c==0:
        print("Yes")
    else:
        print("No")
else:
    print("Yes")
a = raw_input()

print(a*a*a)

### FIXED CODE ###

a = input()

print(a*a*a)
S = list(input())
flag = True

if len(S) % 2 == 0:
  for i in range(0, len(S), 2):
  if S[i] == 'h' and S[i + 1] == 'i':
    pass
  else:
    flag = not flag
    break
else:
  flag = not flag

if flag:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = list(input())
flag = True

if len(S) % 2 == 0:
  for i in range(0, len(S), 2):
    if S[i] == 'h' and S[i + 1] == 'i':
      pass
    else:
      flag = not flag
      break
else:
  flag = not flag

if flag:
  print("Yes")
else:
  print("No")
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from queue import Queue


def input(): return sys.stdin.readline().strip()


def INT(): return int(input())


def MAP(): return map(int, input().split())


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


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
	n = INT()
	a = LIST()
	p = 0
	q = 0
	l = []

	sign = (a[1]-a[0]) / abs(a[1]-a[0])

	for i in range(n-1):
		if a[i] < a[i+1] and sign == -1:
			p += 1
			sign *= -1

		elif a[i] > a[i+1] and sign == 1:
			q += 1
			sign *= -1


	print(max(p, q) + 1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from queue import Queue


def input(): return sys.stdin.readline().strip()


def INT(): return int(input())


def MAP(): return map(int, input().split())


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


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    n = INT()
    a = LIST()

    ans = 0

    if n == 1:
        print(1)
        exit()

    if a[0] < a[1]:
        sign = 1
    elif a[0] > a[1]:
        sign = -1
    else:
        sign = 0

    for i in range(n-1):
        if a[i] < a[i+1] and sign == -1:
            ans += 1
            sign = 0

        elif a[i] > a[i+1] and sign == 1:
            ans += 1
            sign = 0

        elif sign == 0:
            if a[i] < a[i+1]:
                sign = 1
            elif a[i] > a[i+1]:
                sign = -1

    print(ans + 1)


if __name__ == '__main__':
    main()
while 1:
	n,a,b = map(int,raw_input().split())
	if n == 0: break
	dp = [0]*(n+1)
	dp[a] = dp[b] = 1
	for i in range(n+1):
		if dp[i] == 1:
			if i+a < n+1: dp[i+a] = 1
			if i+b < n+1: dp[i+b] = 1
	print n - sum(dp)

### FIXED CODE ###

while 1:
	n,a,b = map(int,raw_input().split())
	if n == 0: break
	S = [1]*(n+1)
	for i in range(a):
		s = b*i
		while s <= n:
			S[s] = 0
			s += a
	print sum(S)
n,k=map(int,input().split())
li=list(map(int,input().split()))
ans=[0]*n
ans[1]=abs(li[0]-li[1])
for i in range(2,n):
    ans[i]=min(map(sum,map(lambda x: abs(x-li[i]),li[max(0,i-k):i]),ans[max(0,i-k):i]))
    
print(ans[n-1])


### FIXED CODE ###

n,k=map(int,input().split())
li=list(map(int,input().split()))
ans=[0]*n
ans[1]=abs(li[0]-li[1])
for i in range(2,n):
    ans[i]=min([y+z for (y,z) in zip(map(lambda x: abs(x-li[i]),li[max(0,i-k):i]),ans[max(0,i-k):i])])
    
print(ans[n-1])