I find this question overly simplistic. For over a decade, entire teams of researchers have been trying to identify sentiment in text. Even the simplest sentences are often difficult, and are highly context-dependent. For example
Read the book.
is a positive sentence if it appears in a book review. The same sentence is negative if it appears in a movie review. As Ingo points out, simply counting positive/negative words will not work out at all. The placement of negators in the parse-tree of the sentence matters, and as my example shows, there are many sentences with no positive/negative words, but different sentiment polarities in different contexts. Here's another example off the top of my head
The crazy movie held its audience captive.
but,
The crazy king held the peasants captive.