You think that's weird? Try this:
1 = 0 = x = 1-1+1-1+1-1+... =
= 1-(1-1+1-1+1-1+...) =
1-x
so x, in addition to being 0 and 1, is also 1-x. High school algebra yields x=1/2.

The point of all this? You cannot parenthesise the elements of an infinite series if it is divergent, and expect results that make sense. You cannot parenthesise the elements of an infinite series that is not absolutely convergent and expect results that make sense (see Riemann's theorem on parenthesising infinite series that converge but not absolutely for even more amazing stuff).

Caution is warranted when doing calculus. Seemingly innocuous expressions may turn out to be meaningless (or to mean something other than what you think they do).