正n边形有n条边,首个点连除自己和2个邻居以外的n-3个点:

import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.nextInt()*2 - 3);
    }
}