import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    String[] fizzBuzz = new String[n];
    long sum = 0;
    for(int i = 1; i<=n; i++){
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    }
    System.out.println(sum);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    String[] fizzBuzz = new String[n];
    long sum = 0;
    for(int i = 1; i<=n; i++){
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    }
    System.out.println(sum);
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    String[] fizzBuzz = new String[n];
    long sum = 0;
    for(int i = 1; i<=n; i++){
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    }
    System.out.println(sum);
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    String[] fizzBuzz = new String[n];
    long sum = 0;
    for(int i = 1; i<=n; i++){
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    }
    System.out.println(sum);
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(in.readLine()); n Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in String[] fizzBuzz = new String[n]; fizzBuzz new String[n] n long sum = 0; sum 0 for(int i = 1; i<=n; i++){
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    } int i = 1; int i = 1; i 1 i<=n i n i++ i++ i {
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    } {
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    } if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      } i%3==0 && i%5==0 i%3==0 i%3 i 3 0 i%5==0 i%5 i 5 0 {
//        fizzBuzz[i-1] = "FizzBuzz";
      } if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      } i%3==0 i%3 i 3 0 {
//        fizzBuzz[i-1] = "Fizz";
      } if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      } i%5==0 i%5 i 5 0 {
//        fizzBuzz[i-1] = "Buzz";
      } {
        sum += (long)i;
      } sum += (long)i sum (long)i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    String[] fizzBuzz = new String[n];
    long sum = 0;
    for(int i = 1; i<=n; i++){
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    }
    System.out.println(sum);
  }
} public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    String[] fizzBuzz = new String[n];
    long sum = 0;
    for(int i = 1; i<=n; i++){
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    }
    System.out.println(sum);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    String[] fizzBuzz = new String[n];
    long sum = 0;
    for(int i = 1; i<=n; i++){
      if(i%3==0 && i%5==0){
//        fizzBuzz[i-1] = "FizzBuzz";
      } else if(i%3==0){
//        fizzBuzz[i-1] = "Fizz";
      } else if(i%5==0){
//        fizzBuzz[i-1] = "Buzz";
      } else {
        sum += (long)i;
      }
    }
    System.out.println(sum);
  }
}