Problem:


Score : 100 points

Problem Statement

How many ways are there to choose two distinct positive integers totaling N, disregarding the order?

Constraints

1 \leq N \leq 10^6

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

4

Sample Output 1

1

There is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)

Sample Input 2

999999

Sample Output 2

499999



Sample input:
4


Sample output:
1

Submission status: Accepted

Solution code:
n = int(input())
if n%2 ==0:
    cnt = n/2 - 1
elif n%2 !=0:
    cnt = n//2
print(int(cnt))

Submission status: Accepted

Solution code:
N = int(input())

if N%2 == 0:
    print(int(N//2-1))
else:
    print(int((N+1)//2-1))

Submission status: Accepted

Solution code:
n = int(input())
if(n%2==0):
    print(int(n/2-1))
else:
    print(n//2)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
if N % 2 == 0:
  ans = N // 2 - 1
else:
  ans = N // 2

print(ans)

Submission status: Accepted

Solution code:
N=int(input())

if N%2==1:
	print(N//2)
else:
  print(int(N/2-1))

Submission status: Accepted

Solution code:
def sum(a):
    c=0
    if a%2==0:
        n=a//2
    else:
        n=a//2+1
    for i in range(1,n):
        if a-i<a and a-i>=1:
            c=c+1
    return c
a=int(input())
print(sum(a))

Submission status: Accepted

Solution code:
N = int(input())
if N%2 == 0:
  print((N-2)//2)
else:
  print((N-1)//2)

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    return str(n//2-1 if n % 2 == 0 else n//2)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 1:
  print(n//2)
else:
  print(n//2 - 1)

Submission status: Accepted

Solution code:
import math
n = int(input())
ans = math.ceil(n/2) - 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

if n==0 or n==1 or n==2:
  print(0)
elif n==3:
  print(1)
elif n%2==1:#奇数
  print(int(n/2))
elif n%2!=1:#偶数
  print(int(n/2)-1)

Submission status: Accepted

Solution code:
N = int(input())

count = 0

if N % 2 == 0:
    for i in range(1,int(N/2)):
        if i != N-i:
            count+=1
else:
    for i in range(1,int(N/2)+1):
        if i != N:
            count+=1
print(count)

Submission status: Accepted

Solution code:
import math
n = int(input())
x = math.sqrt(n)
if n == 1:
    print(0)
elif n % 2 == 1:
    print(math.floor(n/2))
elif n % 2 == 0:
    print(round(n/2)-1)

Submission status: Accepted

Solution code:
N = int(input())
half = 0
if N % 2 == 0:
  half = N//2-1
else:
  half = N//2
print(half)

Submission status: Accepted

Solution code:
n = int(input())

count = 0
for i in range(1,n//2+1):
    if not n - i == i:
        count +=1
        
print(count)

Submission status: Accepted

Solution code:
import math

n = int(input())

print(math.ceil(n/2)-1)

Submission status: Accepted

Solution code:
n = int(input())

count = 0

if n < 2:
  print(0)
  exit()
  
for i in range(n//2):
  a = i + 1
  b = n - a
  if a != b and a > 0 and b > 0:
    count = count + 1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
counter = 0

if n%2 == 0:
    half = n//2
else:
    half = (n-1)//2
for i in range(1, half+1):
    if i != n-i:
        counter +=1

print(counter)

Submission status: Accepted

Solution code:
N = int(input())
ctr = 0
if N <= 2:
	print(0)
else:
	if (N - 2) % 2 == 0:
		print(N // 2 - 1)
	else:
		print((N - 1) // 2)

Submission status: Accepted

Solution code:
a=int(input())

print(int((a-1)/2))

Submission status: Accepted

Solution code:
N = int(input())

if (N % 2 == 0):
    print(int(N / 2) - 1)
else:
    print(int(N / 2))

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
  print(n//2 - 1)
else:
  print((n-1)//2)

Submission status: Accepted

Solution code:
N = int(input())
print(int((N-1) / 2))

Submission status: Accepted

Solution code:
import math
N = int(input())
count = 0
N = N / 2 - 0.1
print(math.floor(N))

Submission status: Accepted

Solution code:

N = int(input())


if N%2==0:
    print(int(N/2-1))
else:
    print(int(N/2))

Submission status: Accepted

Solution code:
N = int(input())
N = N-1
ANS = N//2
print(ANS)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
if n % 2 == 0:
  # 偶数
  ans = (n / 2) - 1
else:
  ans = n // 2

print(int(ans))

Submission status: Accepted

Solution code:
n = int(input());

ans = 0
if n % 2 == 0:
    ans = n // 2 - 1
else:
    ans = n // 2
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

#input
N = int(input())

#output
if N % 2 == 0:
    print(N//2-1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())

ar = np.array(range(1, (n // 2) + 1))


br = n - ar

# print(ar, br)
# print(ar != br)
print(np.count_nonzero(ar != br))

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
  print(N//2-1)
else:
  print(N//2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import math

# 整数の入力
N = int(input())

if N%2 == 1 :
  print (int(math.floor(N/2)))
else :
  print (int((N/2)-1))

Submission status: Accepted

Solution code:
N = int(input())

if N%2 == 0:
    print(int(N/2)-1)
else:
    print(int(N//2))

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for i in range(n//2):
	if (i+1)+ (i+1) == n:
		continue
	cnt +=1
print (cnt)

Submission status: Accepted

Solution code:
n=int(input())
if n%2==0:
  ans=n//2-1
else:
  ans=n//2

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

print((N - 1)//2)

Submission status: Accepted

Solution code:
N=int(input())

if N%2 == 0:
    print(N//2 -1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
n = int(input())
a = 0
if n % 2 == 0:
    a = n / 2 - 1
else:
    a = (n-1)/2

print(int(a))

Submission status: Accepted

Solution code:
N = int(input())

mycnt = 0


if N%2 ==0:
    mylen = int(N/2)
else:
    mylen = int(N/2)+1
for i in range(mylen):
    if N - i < N:
        mycnt += 1

print(mycnt)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1, N+1):
    if N - i > 0 and i != N - i and i < N - i:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = input()
N = int(N)

out = int((N-1)/2)
print(out)

Submission status: Accepted

Solution code:
N = int(input())

if N % 2:
    print(N // 2)
else:
    print(N // 2 - 1)

Submission status: Accepted

Solution code:
num = int(input())
print((num-1)//2)

Submission status: Accepted

Solution code:
import math
print(math.ceil(int(input())/2) -1)

Submission status: Accepted

Solution code:
n = int(input())

print((n-1) //2)

Submission status: Accepted

Solution code:
n = int(input())
ans = (n//2)
if n%2==0:
    ans=ans-1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())

if N%2==1:
    print(int(N//2))

else:
    print(int(N/2-1))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = int(input())

if N%2 == 0:
    print(int(N/2)-1)
else:
    print(int(N/2))

Submission status: Accepted

Solution code:
N=int(input())

print([0 if N<3 else (N-1)//2][0])

Submission status: Accepted

Solution code:

#inputは文字列として取得
input=input()
#splitする必要がある
input=input.split(" ")

N=int(input[0])

ans=None

if N%2==0:
    ans=N/2-1
else:
    ans=(N-1)/2

print(int(ans))

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
if N%2 == 0:
    ans= N//2 -1
else:
    ans = (N-1)//2
print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())

if n % 2 == 0:
  ans = math.floor(n/2) -1
  
else:
  ans = math.floor(n/2)

print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
print(math.ceil(n/2)-1)

Submission status: Accepted

Solution code:
N = int(input())
a = N//2-1 if N%2==0 else N//2
print(a)

Submission status: Accepted

Solution code:
N = int(input())

if N%2 == 0:
    print(N//2 -1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
n = int(input())


if n%2 == 0:
  print(int(n/2-1))
else:
  print(int(n/2))

Submission status: Accepted

Solution code:
N = int(input())

if N % 2 == 0:
    print(N//2 - 1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 1:
    print(n // 2)
else:
    print((n // 2) - 1)

Submission status: Accepted

Solution code:
import numpy as np

n=int(input())
print(int(np.ceil(n/2)-1))

Submission status: Accepted

Solution code:
a=int(input())

if(a==0 or a==1):
    print("0")
else:
    if(a%2==0):
        print(int(a/2-1))
    else:
        print(int(a/2))

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    print(int(n/2-1))
else:
    print(int(n//2))

Submission status: Accepted

Solution code:
N = int(input())

if not N % 2: print(N//2-1)
else: print((N-1)//2)

Submission status: Accepted

Solution code:

n = int(input())
ans = 0
for i in range(1,n//2+1):
    if(n-i != i):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#第二回全国統一プログラミング王決定戦予選 A

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
if n % 2 == 0:
    print(n//2 - 1)
else:
    print(n//2)

Submission status: Accepted

Solution code:
n=int(input())
ans=0
m=int(n/2) if n%2==0 else int(n/2+1)
for i in range(1,m):
    if(n-i>0):
        ans+=1;
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
if n==1 or n==2:
  print(0)
elif n%2==0:
  print(int((n/2)-1))
else:
  print(int(n//2))

Submission status: Accepted

Solution code:
n = int(input())
print((n - 1)// 2)

Submission status: Accepted

Solution code:
input_n = int(input())

if input_n % 2 == 0:
    res = input_n / 2 - 1
else:
    res = (input_n - 1) / 2

print(int(res))

Submission status: Accepted

Solution code:
n=int(input())
if n%2==0:
    print(int((n/2)-1))
else:
    print(int(n/2))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    num_list = set()
    for i in range(1,N+1):
        tmp = N - i
        if i == tmp or tmp == 0:
            continue
        else:
            num_list.add((i,tmp))

    if len(num_list) % 2 == 0:
        print(len(num_list) // 2)
    else:
        print(len(num_list) // 2 + 1)



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def fi(): return float(input())
def mfi(): return map(float, input().rstrip().split())
def lmfi(): return list(map(float, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template


def main():
    n = ii()
    if n % 2 == 0:
        print(n // 2 - 1)
    else:
        print((n - 1) // 2)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N =int(input())
if N%2==1:
  print(int((N-1)/2))
else:
  print(int((N/2)-1))

Submission status: Accepted

Solution code:
n = int(input())

ans = (n-1)//2

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
count = 0
for i in range(N):
  if N - (i+1) != (i+1):
    count += 1
print(int(count/2))

Submission status: Accepted

Solution code:
N = int(input())

print((N - 1) // 2)

Submission status: Accepted

Solution code:
a=int(input())
if a%2==1:
  print(a//2)
else:
  print(a//2-1)

Submission status: Accepted

Solution code:
a = int(input())
if(a%2==0):
  print(a//2-1)
if(a%2==1):
  print(a//2)

Submission status: Accepted

Solution code:
import numpy as np

input = list(map(int,input().split()))

N = input[0]

if N%2==0:
  ans = int(N/2-1)
else:
  ans = int((N-1)/2)

print(ans)

Submission status: Accepted

Solution code:
a = int(input())

if a < 4:
  print(0)
else:
  a -= 1
  print(a//2)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    temp = n - 1
    ans = temp // 2
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def read():
    N = int(input().strip())
    return N, 

def solve(N):
    x = 1
    y = N - x
    count = 0
    while x < N - x:
        x += 1
    return x - 1

if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

Submission status: Accepted

Solution code:
n = int(input())
c=0
done = set()
for i in range (1,n):
    need = n-i
    if need != i and i not in done and need not in done:
        done.add(i);done.add(need)
        c+=1
print(c)

Submission status: Accepted

Solution code:
import math
print(math.floor((int(input())-1)/2))

Submission status: Accepted

Solution code:
N=int(input())
print((N-1)//2)

Submission status: Accepted

Solution code:
N = int(input())

if N % 2 == 1:
  print(int((N-1)/2))
else:
  print(int(N/2-1))

Submission status: Accepted

Solution code:
N=int(input())
ans=0
for i in range(1,N//2+1):
    if N-i>0 and N!=2*i:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
count = 0

for i in range(1, int(n/2)+1):
    if i != n - i:
        count += 1

print(count)

Submission status: Accepted

Solution code:
n=int(input())
if n%2 == 0:
    print((n>>1)-1)
else:
    print(n>>1)

Submission status: Accepted

Solution code:
n = int(input())
print(n // 2) if n % 2 == 1 else print(n // 2 -1)

Submission status: Accepted

Solution code:
a=int(input())
if a%2==0:
    print((a//2)-1)
else:
    print(a//2)

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
  print(N//2 - 1)
else:
  print(N//2)

Submission status: Accepted

Solution code:
from sys import stdin
import fractions

n = int(stdin.readline().rstrip())

if n %2 == 1:
    print(n//2)
else:
    print(n//2-1)

Submission status: Accepted

Solution code:
import math

N=int(input())
print(max(math.floor(N/2-0.5),0))

Submission status: Accepted

Solution code:
def q1(n):
    return (n - 1) // 2


if __name__ == '__main__':
    n = int(input())
    print(q1(n))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def print_ans(N):
    """Test Case
    >>> print_ans(4)
    1
    >>> print_ans(999999)
    499999
    """
    q, mod = divmod(N,2)
    if(mod == 0):
        print(q - 1)
    else:
        print(q)


if __name__ == '__main__':
    N = int(input().rstrip())
    print_ans(N)

Submission status: Accepted

Solution code:
#a,b = map(int,input().split())
n = int(input())
counter = 0
for a in range(1,n):
    b = n-a
    if b != a:
        #print("ab",a,b)
        counter += 1
print(counter//2)

Submission status: Accepted

Solution code:
n=int(input()) 
if n%2 == 0:
  print(int(n/2-1))
else:
  print(int((n-1)/2))

Submission status: Accepted

Solution code:
import math
n = int(input())

print(math.ceil(n/2) -1)

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
	print(n // 2 - 1)
else:
	print(n // 2)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    count = 0
    for i in range(1, N):
        if i != N - i or 0 != N - 1:
            count += 1

    print(count // 2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = n // 2
if n%2==0:
    print(a-1)
else:
    print(a)

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for i in range(1, N + 1):
  a = i
  b = N - i
  if a != b:
    cnt += 1
print(cnt // 2)

Submission status: Accepted

Solution code:
import sys; readline = sys.stdin.readline
from collections import deque

N = int(readline())
print((N - 1)//2)

Submission status: Accepted

Solution code:
n = int(input())
answer = (n - 1) // 2
print(answer)

Submission status: Accepted

Solution code:
import math

x = int(input())

print(math.ceil(x/2-1))

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for i in range(1,n):
    count += 1
m = n // 2

print(count - m)

Submission status: Accepted

Solution code:
N = int(input().strip())

if N % 2 == 0:
    print((N-1)//2)
else:
    print(N//2)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def main():
    N = int(input())
    if N%2==0:
        print(N//2-1)
    else:
        print(N//2)
        

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys


def answer():
    input = sys.stdin.readline
    N = int(input())

    print((N-1) // 2)


if __name__ == '__main__':
    answer()

Submission status: Accepted

Solution code:
n = int(input())
print(n//2-1+n%2)

Submission status: Accepted

Solution code:
N = int(input())

if N%2 == 0 :
  print(int((N/2)-1))
else :
  print(int(N/2))

Submission status: Accepted

Solution code:
n = int(input())
print((n-1) // 2)

Submission status: Accepted

Solution code:
N=int(input())

if N/2==0:
    print(N//2)
else:
    print((N-1)//2)

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 1:
    ans = n//2
else:
    ans = n/2-1

print(int(ans))

Submission status: Accepted

Solution code:
a = int(input())
print (int((a-1)/2))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
if n % 2 != 0:
    n += 1
print(n // 2 - 1)

Submission status: Accepted

Solution code:
t = int(input())
if t % 2 == 0:
    print(t//2 - 1)
else:
    print((t-1)//2)

Submission status: Accepted

Solution code:
n = int(input())
if n%2 == 0:
    print(int((n-2)/2))
else:
    print(int((n-1)/2))

Submission status: Accepted

Solution code:
n = int(input())

if n%2 == 0:
    print(int(n/2)-1)
else:
    print(int(n/2))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def solve(n):
    used = set()
    for a in range(1, n + 1):
        b = n - a
        if a < b:
            used.add((a, b))
    return len(used)
def main():
    n = int(input())
    print(solve(n))
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

if n%2==0:
    print(n//2-1)
else:
    print((n-1)//2)

Submission status: Accepted

Solution code:
N=input()
S=set()
for a in range(1,10**6+1):
    b=N-a
    if b>0:
        if a>b: a,b=b,a
        if a!=b:
            S.add((a,b))
    
print len(S)

Submission status: Accepted

Solution code:
N = int(input())
if N%2 == 0:
    print(N//2 - 1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
n = int(input())
count = 0

for i in range(1, int(n/2)+1):
    x = n - i  
    if x != i:
        count+=1
print(count)

Submission status: Accepted

Solution code:
import sys

n = int(input())

if n <= 3:
    print(0)
    sys.exit()

if n%2==0:
    print(n//2-1)
else:
    print(n//2)

Submission status: Accepted

Solution code:
N = int(input())

res = 0

for i in range(1,N//2+1):
    temp = N - i
    if i != temp:
        res += 1

print(res)

Submission status: Accepted

Solution code:
N = int(input())
ans = int(N / 2)
if N % 2 == 0:
    ans -= 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

counter = 0
for x in range(1, N//2 + 1):
    y = N - x
    if 0 < y and y != x:
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
n=int(input())

print((n-1)//2)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    if n % 2 == 0:
        print(n // 2 - 1)
    else:
        print(n // 2)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
print(n//2-(not n&1))

Submission status: Accepted

Solution code:
a = int(input())
if a % 2 == 0:
    print(int(int(a/2) - 1))
else:
    print(int(a/2))

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(1, N):
    j = N - i
    if j > 1 and j > i:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
count = 0
for i in range(1, math.ceil(n / 2)):
    count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 ==0:
  print(int(N / 2 - 1))
else:
  print(int((N-1) / 2))

Submission status: Accepted

Solution code:
n=int(input())
if n%2==1:
	n=n-1
else:
	n=n-2
print(int(n/2))

Submission status: Accepted

Solution code:
n = int(input())
ans = n // 2

if n % 2 == 0:
    ans -= 1

print(ans)

Submission status: Accepted

Solution code:
import sys

def main():
    N = int(input())
    c = 0
    for i in range(1, N):
        j = N - i
        if j <= i:
            break
        c += 1
    print(c)

main()

Submission status: Accepted

Solution code:
n=int(input())
if n%2==0:
    print(n//2-1)
else:
    print((n-1)//2)

Submission status: Accepted

Solution code:
n = int(input())
ct = 0

for i in range(1,int(n/2)+1):
    if i == n-i:
        continue
    ct += 1

print(ct)

Submission status: Accepted

Solution code:
n = int(input()) 

if n%2 == 0:
    print((n)//2-1)
else:
    print((n+1)//2-1)

Submission status: Accepted

Solution code:
print((int(input()) - 1)//2)

Submission status: Accepted

Solution code:
N = int(input())
print(N // 2 if N % 2 else N // 2 - 1)

Submission status: Accepted

Solution code:
N = int(input())
if N%2 == 0:
    ans=N//2 -1
else:
    ans=(N+1)//2 -1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
ans = 0

if N % 2 == 0:
    ans = (N - 2) // 2
    print(ans)

if N % 2 != 0:
    ans = (N - 1) // 2
    print(ans)

Submission status: Accepted

Solution code:
N = int(input())
if N%2 == 0:
    print(int(N/2-1))
else:
    print(int(N/2))

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    n = n//2 - 1
else:
    n = n // 2

print(n)

Submission status: Accepted

Solution code:
a = int(input())
if a%2 == 0:
    b = a/2 - 1
else: b = (a + 1)/2 - 1
print(int(b))

Submission status: Accepted

Solution code:
N = int(input())
if N<=2:
    print(0)
elif N<=4:
    print(1)
elif N<=6:
    print(2)
else:
    print((N-7)//2+3)

Submission status: Accepted

Solution code:
N = int(input())

if N%2 == 0:
    print N/2 -1
else:
    print N/2

Submission status: Accepted

Solution code:
N = int(input())

if (N-1)%2 == 0:
    print(int((N-1)/2))
else:
    print(int((N-2)/2))

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
  print(n//2-1)
else:
  print(n//2)

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
    print((n // 2) - 1)
elif n % 2 == 1:
    print((n - 1) // 2)

Submission status: Accepted

Solution code:
import sys
N = int(input())
if N%2==0:
    val = int(N / 2) - 1
else:
    val = int(N / 2)
print(val)

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 1:
    print(n//2)
else:
    print((n//2) - 1)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

if N % 2 == 0:
  print(int((N/2)-1))
else:
  print(int(((N-1)/2)))

Submission status: Accepted

Solution code:
def main(n):
    if n % 2 != 0:
        n += 1
    half = n // 2
    return half - 1


if __name__ == '__main__':
    N = int(input())
    print(main(N))

Submission status: Accepted

Solution code:
n = int(raw_input())
if n % 2 == 0:
    print (n / 2) - 1
else:
    print n / 2

Submission status: Accepted

Solution code:
N = int(input())

ans = (N - 1)// 2

print(ans)

Submission status: Accepted

Solution code:
# 入力
N = int(input())

if N % 2 != 0:
    print(int(N/2))
else:
    print(int(N/2)-1)

Submission status: Accepted

Solution code:
n=int(input())

if n%2==0:
    print((n-2)//2)
else:
    print(n//2)

Submission status: Accepted

Solution code:
import math
print(math.ceil(int(input()) / 2) - 1)

Submission status: Accepted

Solution code:
n=int(input())
if n%2==1:
  print((n-1)//2)
else:
  print(n//2-1)

Submission status: Accepted

Solution code:
N = int(input())
if N%2==1:
    print(int((N-1)/2))
else:
    print(int((N-2)/2))

Submission status: Accepted

Solution code:
import math

n=int(input())

print(math.floor((n-1) / 2))

Submission status: Accepted

Solution code:
N = int(input())
count = 0
for i in range(1, N//2+1):
    if (N-i) >= 1 and i+i != N:
        count+=1
print(count)

Submission status: Accepted

Solution code:
a=int(input())
if a % 2 == 0:
    print(str(int(a / 2-1)))
else:
    print(str(int((a-1)/2)))

Submission status: Accepted

Solution code:
s=list(map(int,input().split()))
if s[0]==1:
  print(0)
elif s[0]!=1 and s[0]%2==0:
  a=int(s[0]//2-1)
  print(a)
else:
  a=int(s[0]//2)
  print(a)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 18
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
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 = 1000000007


n = I()
print((n - 1) // 2)

Submission status: Accepted

Solution code:
n = int(input())

c = 0

if n%2 == 0:
  print(n//2 - 1)
else:
  print(n//2)

Submission status: Accepted

Solution code:
N = int(input())
if N%2==0:
    ans = N//2-1
    print(ans)
else:
    ans = N//2
    print(ans)

Submission status: Accepted

Solution code:
# A - Sum of Two Integers
N = int(input())

if N % 2 ==0:
    ans = (N-2)/2
else:
    ans = (N-1)/2
print(int(ans))

Submission status: Accepted

Solution code:
n = int(input())
answer=0
if n % 2 == 0:
    answer=n/2-1
else:
    answer=(n-1)/2
print(int(answer))

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 1:
    ans = (n-1) // 2
else:
    ans = (n-2) // 2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

if n%2==0:
    print(int(n/2-1))
else:
    print(int((n-1)/2))

Submission status: Accepted

Solution code:
n=int(input())
if n%2==0:
    print(n//2-1)
else:
    print(n//2)

Submission status: Accepted

Solution code:
N=int(input())
M=0
for i in range(1,N):
    if N-i>0 and N//2<i:
        M+=1
print(M)

Submission status: Accepted

Solution code:
import numpy as np


N = int(input())

if N % 2 == 0:
    print(int((N - 2) / 2))
else:
    print(int((N - 1) / 2))

Submission status: Accepted

Solution code:
import sys

def solve(a):
    if a % 2 == 0:
        print(a // 2 - 1)
    else:
        print(a // 2)

if __name__ == '__main__':
    a = int(sys.stdin.readline().strip())
    solve(a)

Submission status: Accepted

Solution code:
n = int(input())

print(n//2-bool(not(n%2)))

Submission status: Accepted

Solution code:
N=int(input())
ret=(N-1)/2//1
print(int(ret))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())

if N % 2 == 0:
    print((N // 2) - 1)
else:
    print(N // 2)

Submission status: Accepted

Solution code:
n = int(input())

if n%2==0:
    n/=2
    n-=1
    print(int(n))
else:
    n+=1
    n/=2
    n-=1
    print(int(n))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = int(input())

if a % 2 == 0:
    r = a/2 -1
else:
    r = (a-1)/2

print("{}".format(int(r)))

Submission status: Accepted

Solution code:
N=int(input())

if N%2==0:
    print((N-1)//2)
else:
    print(N//2)

Submission status: Accepted

Solution code:
import math

N = int(input())

print(math.floor((N-1)/2))

Submission status: Accepted

Solution code:
N = int(input())
if N%2 == 0:
    print(int(N/2 - 1))
else:
    print(int((N-1)/2))

Submission status: Accepted

Solution code:
N = int(input())
import math
print(math.ceil(N/2)-1)

Submission status: Accepted

Solution code:
N  = int(input())
if N%2 == 0:
    print(N//2 - 1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    if N == 1 or N == 2:
        print(0)
        return

    print((N-1)//2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

_n = int(input())

print((_n - 1) // 2)

Submission status: Accepted

Solution code:
string = input()
n = int(string)
print((n - 1) // 2)

Submission status: Accepted

Solution code:
N=int(input())
print(int(N/2-1) if N%2==0 else int((N-1)/2))

Submission status: Accepted

Solution code:
import sys
inputs = sys.stdin.readlines()
n = int(inputs[0])

if n % 2 == 0:
    print(n // 2 - 1)
else:
    print(n // 2)

Submission status: Accepted

Solution code:
N = int(input())

if N % 2 == 0:
    N = int(N/2 - 1)
else:
    N = int((N-1)/2)

print(N)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N+1):
    b = N - a
    if a > 0 and b > 0 and a != b:
        ans += 1
ans //= 2
print(ans)

Submission status: Accepted

Solution code:
N=int(input())

if N%2==0:
  print((N//2)-1)
else:
  print((N+1)//2-1)

Submission status: Accepted

Solution code:
N = int(input())
ans = int((N-1)/2)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n%2==1:
    print((n-1)//2)
else:
    print((n//2)-1)