"Joanna, would you come here a minute, please?"
"Yeah. I'm sorry I was late, but I was having lunch. I, uh..."
"We need to talk about your flair."

"Really? I have fifteen pieces on. I also..."
"Well, fifteen is the minimum. Okay?"
"Now, it's up to you whether or not you want to just do the bare minimum or... Brian, for example has 37 pieces of flair on today. And a terrific smile. :-D"
"Okay, so you want me to wear more?"
"Joanna... People can get a cheeseburger anywhere, okay? They come to Chotchkie's for the atmosphere and the attitude. That's what the flair's about. It's about fun."
"Okay, so more then, yeah?"

"Look, we want you to express yourself, okay? Now if you feel that the bare minimum is enough, then, okay... but some people choose to wear more and we encourage that, okay? You do want to express yourself, don't you?"
"Okay, great, great. That's all I ask."


Joanna wants to adjust her number of flair pieces. In order to do that, this is her method of choice:

  1. Take the set {1, 2, …, N}.
  2. Give each element a sign (+ or -).
  3. Evaluate the expression and add the result to her current flair number.

Joanna wants her flair number to either stay the same, or increase by as little as possible. Depending on how large the result is, our protagonist might decide to quit her crappy job and apply for a considerably better position at Endava. Your task is to tell Joanna her new flair number, using the aforementioned method.


A single integer, N.


A single integer, Joanna's new number of flair pieces.


  • 1 ≤ N ≤ 106
  • Initially, Joanna has 15 pieces of flair.
  • The printer got what it deserved.
  • You will receive full feedback for this problem.


11615 + (+1) = 16
3 1515 + (+1+2-3) = 15

Sponsors Gold