Far from sending a Wairarapa farmer to sleep, counting sheep gave him a ten-billion-dollar idea.
It was 1978, the era of flared jeans, big sideburns, the Atari 800 and other early home computing clunkers; the World Wide Web was more than a decade away.
Mt Bruce farmer Ian Campbell was battling writer's cramp while noting stud ram details in a ledger when an idea hit him that, out of a small Masterton office, would take New Zealand farming from Red Bands to broadband.
Campbell bought a $17,000 computer, taught himself to write software and, in 1981, launched what is now the country's largest provider of rural software; it manages the finances of thousands of farms around the nation and overseas with, together, an estimated annual turnover of $10 billion.
That figure comes from Campbell's former business partner Brian Eccles, now managing director of CRS Software Ltd, which grew out of Campbell's 1978 ram-counting epiphany that information technology could boost farming profit.
Eccles was working for Campbell as a shepherd at the time. "He did visualise how computers could really change things for farms - it was the original farm budgeting and forecasting tool," Eccles said.
Eccles got his own farm and was named Wairarapa Farmer of the Year; around 1988 he joined Campbell and fellow farmer David Howden at Computer Concepts, as it was then called.
The company gained traction helping farmers manage the removal of farming subsidies and the introduction of GST, and by the late 1990s it had bought out its major competitor, Lincoln Software. Eccles took full ownership around 2002.
CRS has concentrated on one, specialised product, its Cashmanager Rural software. Unlike accounting packages such as MYOB, it's just for farmers and is as much about product analysis, inventory and projections as it is about accountancy.
Weather and seasonal variations and, especially, the production of living things made farming different from every other type of business, Eccles said.
"Livestock has the strange habit of multiplying, which other stock doesn't do; and, worse, dying."
The software gives farmers confidence that their unrelenting inputs are paying off.
"You have to spend money to make money, but on a farm it's often hard to see where it went and make sure you're turning that spending into profit."
Key to CRS's success has been its Masterton base; it means a supply of IT and customer service professionals with an affinity for farming which, Eccles said, can't be faked.
"If we'd had an address in the the centre of Auckland we'd have had to spend an awful lot of money on marketing to get over that."
The firm's early product was generally the first piece of software farmers had ever used. From day one, a user-friendly mantra was vital, coupled with unlimited, free phone support; if tweaks were needed the firm knew immediately, and paid for it, as phones ran hot.
As farming has evolved, so has the product; 50 per cent of clients now use the cloud-based version, taking information "out of the office and into the paddock". A mobile version launches later this year.
Eccles wouldn't reveal exact revenues or client numbers but said growth has been "double-digit" over the past three years.
The sector's constant changes - such as more farmers needing to compare production across several properties, and owning ever-larger farms - make research and development a permanent overhead.
Eccles anticipated increasing staff from the current 35 to 40 by year's end at the firm's new, purpose-built premises in Masterton, not far from where it all began in a Wairarapa ram paddock.
$450: Annual subscription to Cashmanager Rural software
32,000: Client queries solved annually by CRS Software's 12 telephone support staff
2500: Customers in Australia
26,000: The number of commercial farmers in New Zealand, making up CRS's "target market"